Legacy Knowledge Base
Published Jul. 2, 2025

Why are my theme JS and CSS changes showing only if I clear the server's cache?

Written By

Liferay Support

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.

Issue

  • While working on theme development and deployment, both on Development and Production environments, it will be necessary to clear the server and browser's cache in order to see the changes done on the theme resources like JS and CSS files

Environment

  • Liferay DXP 7.0+

Resolution

  • For a Development environment, add this property in your portal-ext.properties file: include-and-override=portal-developer.properties. After this is done, restart the server.
    You may find all information at Using Developer Mode with Themes. Please note, this may have impact on the portal's performance and it is therefore not advised for production environments.

  • For a Production environment, the supported way is to:
      1. Shut down the server
      2. Delete the following folders: Liferay/osgi/state, Liferay/work, Tomcat/work and Tomcat/temp
      3. Place the updated version of the theme in the deploy folder
      4. Restart the server

This is necessary as a server configured for production caches very aggressively in order to optimize the performance.  To elaborate, not using portal-developer.properties negates the possibility of deploying JS/CSS resources changes in a theme without restarting the server. In other words: development needs an underlying development configuration to optimally work.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base