Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Clearing browser cache
I am having one liferay production server live.
For next release we have changed some javascript files.
Liferay minifies js and css files which are also cached in browser.
After next deployment users have to clear browser cache to see updated changes.
Is there any way I can forcefully clear browser cache?
We can apply release version while loading js and css file as suggested here.
But I am not sure how can I achieve this kind of solution for js files in portlet and for js file in theme.
If anyone has achieved same with this or some other way, please help me to achieve the same.
Thanks,
Pratik Parekh
For next release we have changed some javascript files.
Liferay minifies js and css files which are also cached in browser.
After next deployment users have to clear browser cache to see updated changes.
Is there any way I can forcefully clear browser cache?
We can apply release version while loading js and css file as suggested here.
But I am not sure how can I achieve this kind of solution for js files in portlet and for js file in theme.
If anyone has achieved same with this or some other way, please help me to achieve the same.
Thanks,
Pratik Parekh
You don't have to worry about it.
Liferay stamps all static urls w/ an extra argument, t. You'll see this on every static URL the portal generates. When you view source on the page, you'll see that, for example, main.css is pulled in but there's an additional argument like &t=1341589290000.
This is the "time" for the last modified on the file on the server side. When you push a new file, that &t will change in the URL. Since the browser is caching based on URL matching, the new URL w/ the new timestamp will not match and the browser will fetch it again because it is a cache miss.
Liferay stamps all static urls w/ an extra argument, t. You'll see this on every static URL the portal generates. When you view source on the page, you'll see that, for example, main.css is pulled in but there's an additional argument like &t=1341589290000.
This is the "time" for the last modified on the file on the server side. When you push a new file, that &t will change in the URL. Since the browser is caching based on URL matching, the new URL w/ the new timestamp will not match and the browser will fetch it again because it is a cache miss.
David H Nebinger:
You don't have to worry about it.
...unless you've changed the files directly on the server. Then worry about it, and change the files properly by deploying an updated theme. Doing this means, you don't have to worry about it any more.
Olaf Kock:
David H Nebinger:You don't have to worry about it.
...unless you've changed the files directly on the server. Then worry about it, and change the files properly by deploying an updated theme. Doing this means, you don't have to worry about it any more.
Yes, Olaf is right, I shouldn't have assumed that you do things the way liferay documentation, training, etc. all clearly state how updates are to be deployed.
But then again, if you don't do things the right way, I really believe that any backfire that results of it is due to asking for it...
Hi All,Need some help for browser cache issue.I using Liferay 7.0 with Angular 4, when i am creating a Jar and deploying it on Production. Changes on the UI is not getting reflected until i go and clean the browser cache.Do we have any mechanism where browser cache get automatically cleared while deploying the JARS.Currently i have raised a help ticket for the same but still no luck.On my portal-ext.properties i have added:browser.cache.disabled=true
Thanks,Vishal Srivastava
Thanks,Vishal Srivastava
<p>I had this same issue and solved it by building the plugin with e.g. <code>./gradlew clean deploy</code></p>
<p>Hope it helps.</p>
<p>Hope it helps.</p>
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™