views:

21

answers:

1

I have a flex application about 2M need to send to browser, so I want the browser to reserve the file in cache forever unless I upgrade the version.

I have set the ETAG and last-modified tag in http reponse header, but sometimes, when the user click the refresh, the swf file still be reloaded.

So what http response header can I use to reserve the file in browser cache forever?

+1  A: 

Since the file is relatively small (<5mb), you can store it in the offline cache. So long as the file doesn't change often, the offline cache is a great place for the file to live.

Check out:

http://stackoverflow.com/questions/1207150/html-5-offline-caching

You basically just specify an "application manifest" which lists the files that you want to keep around on the user's machine. The browser downloads and saves the files. When the browser requests those files again, they're retrieved from the offline cache instead.

Hope this helps!

mattbasta
Oh! this is very cool, but If the user use IE 6, how they get this feature? upgrade the browser?
zhongshu
Unfortunately, that's about the only solution. IE 6 users are pretty much left out in the cold all the time. Perhaps making your app a little slower for IE 6 users would encourage them to upgrade ;)
mattbasta
I have tried offline cache and testing it using firefox 3.6.8. Unfortunately, I can not make it work stable, sometimes it works, sometimes not. the behaviour is strange, so I give it up. Any way, I will mark your answer.
zhongshu