Configuring Frontend Resource Caching (CSS)
Liferay DXP 2025.Q4+
When you access a page on your site, the page’s load time depends on how it retrieves frontend resources, such as JavaScript or CSS. Cached files are retrieved faster than files the browser must request from the web server.
Most CSS files in Liferay have hashed file names at build time. For example, a clay.css file may appear at run-time with a randomly generated hash value in the name, like clay.(tvERyCVfuRc).css. This hash value represents a unique version of this file, so the browser can identify that the file’s contents haven’t changed. This allows the file to remain in Liferay’s cache indefinitely.
While many CSS resources are cached indefinitely so they only update when the file is redeployed with changed contents, some files have a limited time-to-live (TTL) in the cache. When this time expires, the next request must retrieve the file from the web server again.
Configuring Frontend Cache Behavior
For files not cached indefinitely, you can configure the cache behavior in your Instance Settings:
-
Log in as an administrator.
-
Navigate to Applications (
) → Instance Settings. -
Under Platform, click Infrastructure.
-
Under Virtual Instance Scope, click Frontend Caching.

On this page, you can configure
CSS Style Sheets Max Age Directive Value: The TTL (in seconds) for CSS files.
Send No Cache Directive For CSS Style Sheets: Whether to force checking with the server whether a CSS file has been updated (even if the cached file is valid).
Files with Limited Caching
Most CSS files that Liferay DXP provides out-of-the-box use file hashing automatically, so they are cached indefinitely. The TTL configurations above do not apply.
However, these CSS files cannot be hashed due to their contents, so they have limited TTL in the cache:
-
CSS files provided by the combo servlet
-
CSS files that include dynamically replaced tokens (e.g.,
@base_url@,, orhttps://learn.lxc.liferay.com/o/dialect-theme/images)
CSS token values are deprecated, and not recommended for use.