August 6th, 2013, 11:48 PM
Update webdesign of site with upgrade on jquery
Hello, I migrated my website from an international domain ( sitepor500.com ) to a national domain ( sitepor500.com.BR ) and before I imported the jquery localhost using "jquery/jquery.min.js". Everytime I updated my jQuery I downloaded the most recent version from jquery and then renamed it to jquery.min.js
The problem is that I updated a very old version 1.6 to 1.9. in the national domain but some users are experiencing problems with my website since I use in my new domain the ".on()" method and users with 1.6 cached in their browser do not recognize the on() cause it used to be .live().
So my question is, how can I tell to that users browser that they should download again the file jquery.min.js and erase their cache? My apache in the old domain used to tell browser to cache de jquery.min.js to 12 months. The problem is that I changed the version inside my file and those browsers are not downloading the new version!
Thank you all
August 7th, 2013, 12:10 AM
I do not think there is a way to dump the cache on an individual's browser; I think that would be an end user browser permission setting, that you cannot control. The only quick fix, that may work; would be to redirect your page with an unique query string; something along the lines of:
And... in your updated pages; I would make sure I used cache controls, so this issue does not happen again.
var here = window.location;
window.location.replace(here + "?cache=updated");
August 7th, 2013, 12:58 AM
Hi you are awesome! Adding a parameter in the filename makes the browser request the same file again! Thank you, you saved my day! But I discovered that anoterh good aproach is not using the same name of the file to the library. I discovered it's better change the filename like jquery.min.1.9.js! It's better than upating only the content of the file! Your solution is great but I ended up changing the filename itself and I am also now using a CDN as you can see in my source code importing jquery http://www.sitepor500.com.br
Originally Posted by web_loone08
Comments on this post
Last edited by amandanovaes; August 7th, 2013 at 12:59 AM.
Reason: adding another idea using CDN