rahim asgari
rahim asgari

Reputation: 12437

How to disable js and css caching in 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

Upvotes: 9

Views: 13131

Answers (4)

stiemannkj1
stiemannkj1

Reputation: 4549

To disable caching of JS and CSS resources in Liferay Portal 6.1+*, add the following line to your portal-ext.propeties file:

browser.cache.disabled=true

*This may work in older versions as well, but I haven't tested it.

Upvotes: 1

lisak
lisak

Reputation: 21981

it's all about Liferay servlet filters. You need to turn some of them off. The best place for that is portal-developer-ext.properties.

You make liferay read it by 2 possible ways :

JVM parameter  -Dexternal-properties=portal-developer-ext.properties

or add this property to portal-ext.properties

include-and-override=portal-developer-ext.properties

Upvotes: 6

lucky
lucky

Reputation: 147

Below link have complete details how to manage caching in liferay

http://www.liferay.com/community/forums/-/message_boards/message/10626805

Upvotes: 0

Jakub
Jakub

Reputation: 20475

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

Upvotes: 13

Related Questions