|
|
Q565 How can I prevent an external *.js file from being cached?
irt.org | Knowledge Base | JavaScript | Source | Q565 [ previous next ] Q565 How can I prevent an external *.js file from being cached?I'm not sure if this will work - please let me know - but you might want to try the same trick that is used to reload an image fresh from the server and not from the browsers cache:
The following was submitted by si The previous answer doesn't work & after lots of searching I have not found a clean way of doing this. However, one workaround is to version your .js filenames so 'myscript.js' becomes 'myscript_v1.js'. When you are ready to upload a new release to the server, increment filenames & includes of modified js files. This is now considered a new file & won't be found in the cache. Voila! Its a bit dirty, I know, but the end result is OK! Feedback on 'Q565 How can I prevent an external *.js file from being cached?' |
-- div -->
|