Threaded View
-
24 Jan 2013 11:29 AM #1
Influencing Browser Caching with Sencha Cmd for an ExtJS 4 App
Influencing Browser Caching with Sencha Cmd for an ExtJS 4 App
Is it possible with Sencha Cmd to add a parameter to a script src property to encourage browsers to dump their cached version of the file?
Right now Sencha Cmd turns this:
Into this:HTML Code:<!-- <x-compile> --> <!-- <x-bootstrap> --> <script src="/ext-4.1.1a/ext-debug.js" type="text/javascript"></script> <!-- </x-bootstrap> --> <script src="/app.js" type="text/javascript"></script> <!-- </x-compile> -->
We're running into a minor but annoying problem. Browsers are caching the all-classes.js file and when we push changes (which we do quite frequently, every other day or so) not all users get them until some time later.HTML Code:<script type="text/javascript" src="all-classes.js"></script>
Is it possible to use Sencha Cmd to instead generate something like this:
Where version is just some random number or timestamp that is added so that each time you run Sencha Cmd browsers will see the new parameter and replace their cached versions?HTML Code:<script type="text/javascript" src="all-classes.js?version=43208374"></script>
Thanks!
P.S. My backup plan is to just do this myself using SED or equivalent as part of our deploy process, but figured I wouldn't re-invent the wheel if Cmd could already do it for me. Looked in the docs, didn't see anything about this.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote