Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369754 - JS files served to XHR fail when you update the server, because they are cached
Summary: JS files served to XHR fail when you update the server, because they are cached
Status: RESOLVED WORKSFORME
Alias: None
Product: Orion
Classification: ECD
Component: Server (show other bugs)
Version: 0.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.4 RC3   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 18:02 EST by John J. Barton CLA
Modified: 2012-02-22 12:39 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John J. Barton CLA 2012-01-25 18:02:54 EST
1. Install eclipse-orion-I20120108-2230 
2. Open Chrome browser, login, open navigation page
3. Exit Orion
4. Install eclipse-orion-I20120124-2230
5. Reload the navigation page
The UI does not load.  Control-Shift-R does not help. localStorage.clear() does not help. Your only hope is a) go home and try tomorrow or b) Clear your entire browser cache. 


I hunted down our Chrome cache expert. The problem has two parts. One is that Control+Shift+R does *not* force reload XHRs and two that XHRs are not revalidated.

Bug 30862 - Dynamically inserted subresources aren't revalidated even when the containing document is reloaded
https://bugs.webkit.org/show_bug.cgi?id=30862

The only workarounds today seem to be :
  1) cache busting URLs: post pend a version number URLs so they mismatch when the version changes.
  2) make the cache time magically correct so we flush based on time.

Another soln is to use 'appcache' manifest to specify the cache explicitly. Then change the manifest in the new version.
Comment 1 John Arthorne CLA 2012-01-26 08:40:05 EST
We are supposed to have Cache-Control: no-cache headers on all dynamic content coming back from the server. It is possible we have missed some cases so we'll need to narrow down which XHR resources are being cached.
Comment 2 John J. Barton CLA 2012-01-26 17:00:06 EST
BTW, no-cache means "cache but revalidate before use". As I understand the webkit bug, the late XHRs are not revalidated. But I could be wrong.

See also

http://html5boilerplate.com/docs/Version-Control-with-Cachebusting/
http://requirejs.org/docs/api.html 'urlArgs'
http://bugs.dojotoolkit.org/ticket/13099
Comment 3 John J. Barton CLA 2012-01-27 12:20:52 EST
(In reply to comment #2)
> BTW, no-cache means "cache but revalidate before use". As I understand the
> webkit bug, the late XHRs are not revalidated. But I could be wrong.

I modified the test case on webkit bug 30862 to verify that files served with 
  Cache-control: no-cache
do *not* exhibit 30862.
Comment 4 Simon Kaegi CLA 2012-02-12 23:02:42 EST
Gosia did a change to make JSON responses no store -- leaving this in RC2 to verify.
Comment 5 Simon Kaegi CLA 2012-02-22 12:39:13 EST
Tested. Closing as works for me but I'm sure we will need to continue watching and understanding how the browsers cache.