ASP.NET 4.0
If I updated my .js file in a page, however it seems client's browser doesn't download the new .js file (due to browser cache?). What factors could affect the old .js file remain on client's PC? Is there any way to force client to download new .js file?
EDIT: I still got another question -- How long does the browser keep the .js cache? Is it controlled on client browser setting?
well, your production file is not suposed to chage frequently, try to put a version on your file name, like jquery, a new version generates a file with new name like that:
/myfile.1.0.0.js
to:
/myfile.1.0.1.js
A simple way to get the browser to download a file again is to add a querystring onto the url
/myfile.js?v=1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With