PDA

View Full Version : How to specify that local browser cache is cleared so new Extjs sources are loaded?



siebe vos
24 Dec 2011, 4:50 AM
Probably not a specific ExtJs question, but does anyone know how to specify that local browser cache is cleared so new sources are loaded. When we checkout a new version of our ExtJs 4 (svn source). We want all browser to automatically refresh their local cache so all new sources are loaded (html, javascript, css and images). Apache mod_expires has something similar but we can't set a specific date/time after which all loaded sources are expired.

Thanks in advance!

skirtle
24 Dec 2011, 8:29 PM
I put my custom builds in date-stamped directories to avoid caching problems. In a multi-page app that also has the advantage that you don't necessarily have to upgrade all of your pages at once (useful if you don't have time to test them all against the new version).

siebe vos
4 Jan 2012, 6:06 AM
Hi Skirtle,

Thanks for your reply. That indeed is a solution. Since we use svn and use jscompression to compress the files it is very tricky to just forget to update the version number and we need to update many sources when referring to jscompressed library files. We now update the live sources by updating the timestamp parameter behind our js source like using a script.


<script type="text/javascript" src="/foo/foo.js?version=<timestamp>"></script>


Thanks!