Cache Control header for other content type
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Resolution
-
The
browser.cache.disabled property is checked from the MainServlet and a few other less common servlets. This means that the responses of those servlets would emit the cache control headers for the resources they serve. In the case of MainSerlvet, this means portal pages (basically, HTML content). Nevertheless, other resources get served from different servlets. And those are not making use of that property to determine cache behavior.
Therefore, the cache headers are not being set with other content types such as text/css, text/javascript, img/png is expected behavior with the portal.
-
These other resources manage their own mechanism to invalidate caching, and different servlets control those headers depending on what they serve.
For example, the JSResolveModulesServlet.java, which is in charge of serving module resolutions, set a particular value for those headers purposedly, in a non-configurable way.
- Note: disabling caching of resources entails a very big performance penalty as any resource will be requested from the browser to the server every time a page is visited.
Did this article resolve your issue ?