Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.)

share|improve this question

3 Answers 3

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.

share|improve this answer
    
Thank you for your clear explanation. However the problem I was trying to ask about isn't that the ExtJS library isn't being kept up to date, it is the application code written using ExtJS that isn't being kept up to date. –  jawilmont Apr 9 '13 at 13:14
1  
It is the same problem with a different filename. –  pllee Apr 9 '13 at 13:51

This is a social problem and not really a technological problem. You need to inform the user that your application has updated.

A good example is Google Chrome. It updates in the background, and waits. If you don't restart Google Chrome in about a week, it will give you a humorous message saying something along the lines that 'it's been a long time since you have restarted the browser. Restart the browser to get the updated version.'

You could do something similar. Have a service which responds with the version number of your Application. Send an Ajax request to this service every day or something. and if the version number has incremented, show a message to the user..

share|improve this answer
    
Proper versioning should handle this problem. I can't think of any professional websites that inform their users that the site has updated and they need to clear their cache to see it. –  pllee Jun 5 '13 at 20:10
    
@pllee: Maybe your and my reading of the question is different. As I understand it, OP's Users are not restarting/refreshing the browser at all. They have the App open in a browser for days at a time. –  Devdatta Tengshe Jun 6 '13 at 2:56
    
I can see how you interpreted that. After reading it again I am not entirely sure on what the question is asking. I assumed that the new updated Ext version would be javascript code which could get handled by versioning. –  pllee Jun 6 '13 at 4:33

It seems like you are running into issues with the browser caching older versions of your application and resource files. This is a common problem as web browsers are "greedy" cache-ers and will go through great lengths not to use updated versions.

You have a few options. ExtJS itself supports a "no-cache" option that can be configured via an application load configuration. disable caching configuration. This will cause your browser to fetch each file anew on every load. This can have some negative effects if you application changes rarely (every 3 months or so), but you are forcing users to download MBs of application files for every load. This however is very good when you are in development and code changes regularly.

For the rarely changing app, I use a custom application name ("aka, b3.0-myapp") and include all the app files in the b3.0-myapp directory. When upgrade time happens, I rename the app b3.1-myapp, and move the app directory. You can then do some load failure handlers (aka, their code still tries to load 3.0), and present a message gracefully at that point.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.