Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable js and css caching in liferay?

Tags:

liferay

I am developing a theme for liferay,but liferay caching system does not let me to see changes. How can i disable liferay js and css caching?

PS: I am using Liferay version 5.1.1

like image 234
rahim asgari Avatar asked Nov 04 '09 17:11

rahim asgari


People also ask

Can we prevent CSS caching?

Timestamping Your CSSTo prevent the caching of their scripts, they add a timestamp to the end of the src attribute.

What is CSS caching?

When a browser caches a CSS stylesheet, what it's doing is getting that stylesheet from the server once, saving it, and then serving its own saved version of that stylesheet to the user anytime the page being loaded requests it.


1 Answers

Under Tomcat (bundled)

Edit the setenv.sh file (setenv.bat on windows) Search for the line that sets the JAVA_OPTS variable Add -Dexternal-properties=portal-developer.properties to the list of options For example:

JAVA_OPTS="-Xms256m -Xmx1024m  -XX:PermSize=32m -XX:MaxPermSize=160m -Dfile.encoding=UTF8 -Duser.timezone=GMT+2 
-Djava.security.auth.login.config=$CATALINA_HOME/conf/jaas.config 
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false 
-Dexternal-properties=portal-developer.properties"

Note that this has to be all on one line.

If you were already using the external-properties system property to load some other properties file, add portal-developer.properties with commas.

This is however for the later version 5.2.3+ Not sure why you are still @ 5.1.1, I would update to take advantage of some updated structure and dev handling. In the past there was more work required to get the caching disabled.

Reference: http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Liferay%2BDeveloper%2BMode

like image 157
Jakub Avatar answered Sep 28 '22 08:09

Jakub