Forcing ExtJS application updates after deployment

deploymentextjs

I work on an ExtJS application with a Django backend, and we keep running into issues when we push new code. Our users seldom refresh their browsers, so after a code push we end up with users using the same (now outdated) version of our ExtJS application for days at a time instead of the new, updated version.

How do other people deal with this issue? (I haven't found anything online about this, so I probably haven't found the right keywords yet.)

Best Answer

You are going to want to version you ext file when you deploy. So instead of having:

<script type="text/javascript" src="ext-all.js"></script>

You can have:

<script type="text/javascript" src="ext-all-4-0-2a.js"></script>

It would have a cache header that never expires and when you update to another version the name will have changed and it will force the browser to load the new file.

When you upgrade your to Ext 4.2 for example it would be :

<script type="text/javascript" src="ext-all-4.2.js"></script>

Here is a really good write up on deployment level web devlopment. http://developer.yahoo.com/performance/rules.html Make sure to check out the "Add an Expires or a Cache-Control Header" section which talks about versioning. Versioning should also be done with your component/application level scripts as well.

This is a shameless plug but you can check out the source of my website http://www.coffeedig.com/coffee/ which is a django application written in Ext to see the versioning in action.

Related Topic