Cache Control header for other content type


  • With the following property
    the cache headers are not being set with other content types such as text/csstext/javascriptimg/png 


  • Liferay DXP 7.4


  • 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/csstext/javascriptimg/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, 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.

Additional Information

  • Disable Pragma: no-cache header
  •  #
    # Set this to true if you want the portal to force the browser cache to be
    # disabled. It will only disable the cache for the rendered HTML response.
    # It will not have an impact on static content or other resources.
Was this article helpful?
0 out of 0 found this helpful