I'm trying to package an app for production, but I have noticed that there are problems each time I roll out a new version, since the browser is (rightfully) caching app.js and MyApp-all.css.
Shouldn't production profile generate cache busters for scripts and resources?
Is there a simple solution that doesn't require hacking around (see workaround section)?
Development Environment:
Sencha Cmd v5.1.3.61
ExtJS 4.2 (should be irrelevant)
Ubuntu 14.04
How to reproduce:
sencha generate app -ext MyApp ./MyApp
sencha app build -c production
Result:
build/production/MyApp/index.html contains:
Code:
<link rel="stylesheet" href="resources/MyApp-all.css"/>
<script type="text/javascript" src="app.js"></script>
Expected result:
build/production/MyApp/index.html sould contain:
Code:
<link rel="stylesheet" href="resources/MyApp-all.css?_dc=1234"/>
<script type="text/javascript" src="app.js?_dc=1234"></script>
Workaround:
add to build.xml:
Code:
<target name="-after-build">
<replace file="${app.output.base}/index.html" token="${app.output.js}" value="${app.output.js}?v=${build.timestamp}" />
</target>
Related posts:
https://www.sencha.com/forum/showthr...=1#post1092666
https://www.sencha.com/forum/showthr...l=1#post932598