leaguevine / leaguevine-ultistats

MIT License
18 stars 4 forks source link

Use a cache manifest to keep the files up to date #67

Closed mliu7 closed 12 years ago

mliu7 commented 12 years ago

A high percentage of our users are referencing bugs that have been fixed because their browser is still using old code, often from a few weeks ago. Unless a user clicks refresh in their browser a couple times, there is no way to fix this problem for them. Thus, we need to update our code in the background without having the users to do anything.

One solution to this is to programmatically refresh a cache manifest file. Here's a good tutorial on how to do that:

http://www.html5rocks.com/en/tutorials/appcache/beginner/

mliu7 commented 12 years ago

I'm assigning myself to this issue, as I'd like to take care of this right away. The sooner we have this in place, the more often we can push out updates and be confident that the users are actually seeing them.

mliu7 commented 12 years ago

Here's some more discussion from Stackoverflow:

http://stackoverflow.com/questions/1715568/how-to-properly-invalidate-an-html5-cache-manifest-for-online-offline-web-apps

cboulay commented 12 years ago

This doesn't work for me in Chrome

Application Cache Error event: Failed to parse manifest http://localhost:8000/ultistats.appcache

Since this fails, the rest of the code in main.js also fails including the href interceptor, thus breaking the navbar.

mliu7 commented 12 years ago

Hmmm... It works on ultistats.leaguevine.com. I think it may be something with how it's being served up on node. I didn't realize this because I'm using a leaguevine local server to serve up the app and not using node. I'll see if I can fix node to serve it up as MIME type text/cache-manifest instead.