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
added parameter in url of javascript file in portlet
Im using Liferay 6.06.
I wrote this line in jsp file in a portlet:
<script type="text/javascript" src="<%=request.getContextPath()%>/js/myfile.js"></script>
The url of the file in the broswer is like this:
/js/myfile.js?_=1382519010094
why liferay add _=1382519010094 to the url?
I wrote this line in jsp file in a portlet:
<script type="text/javascript" src="<%=request.getContextPath()%>/js/myfile.js"></script>
The url of the file in the broswer is like this:
/js/myfile.js?_=1382519010094
why liferay add _=1382519010094 to the url?
Hi,
I think Liferay adds it to not cache our js file in your browser.
In portal-developer.properties file, a key exists to avoid this :
{code}
javascript.fast.load=true
javascript.log.enabled=false
{code}
Hope thi help you,
Antoine
I think Liferay adds it to not cache our js file in your browser.
In portal-developer.properties file, a key exists to avoid this :
{code}
javascript.fast.load=true
javascript.log.enabled=false
{code}
Hope thi help you,
Antoine
Thanks but it didn't work for me
Parameters like the given one (a timestamp) are typically used to specifically make content cacheable: While a file named myFile.js might update, so you can't cache it for eternity, a file that has its timestamp in the URL can be cached for eternity, because it will get a new timestamp once it's updated.
The "javascript.fast.load" parameter typically concatenates all js files into a single one (and minifies it) so that you get all JS with a single http request, which is dramatically faster than sending 30 (or however many) individual requests.
The "javascript.fast.load" parameter typically concatenates all js files into a single one (and minifies it) so that you get all JS with a single http request, which is dramatically faster than sending 30 (or however many) individual requests.
Community
Company
Feedback