Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338412

Summary: Safari does not cache JsLibraryServiceHandler request
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 1.4   
Target Milestone: 1.5 M4   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 345120    
Bug Blocks: 323032, 338647    

Description Ralf Sternberg CLA 2011-02-28 09:03:32 EST
Safari does not seem to cache the response of the JsLibraryServiceHandler, which delivers the entire rap js code, although this response has an "Modified" header set. This also affects Mobile Safari. Tested with Safari on Windows, iPad and iPod touch.
Other browsers cache this resource as expected.
Comment 1 Ralf Sternberg CLA 2011-02-28 09:05:45 EST
It seems that there is a special type of "cache-manifest" files for Safari that can be delivered by the web server to identify resources to cache. See this document, section "Caching application files":
http://matt.might.net/articles/how-to-native-iphone-ipad-apps-in-javascript/
Comment 2 Tim Buschtoens CLA 2011-02-28 09:52:31 EST
IE also does not cache the javascript-file. (Tested IE7 and IE9 RC). The "cache-manifset" is an HTML5-feature: http://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/
Comment 3 Tim Buschtoens CLA 2011-02-28 10:10:40 EST
Chaching on the iPhone is a nightmare: http://www.phpied.com/iphone-caching/
Apparently the only thing that seems worth trying is the HTML5-method.
Comment 4 Tim Buschtoens CLA 2011-02-28 10:39:16 EST
As for IE: Cache actually works fine if you are re-entering the URL or use another URL (different startup param). Only when the "reload" action is used the files are all loaded from the server in any case. There seems no way around that. Made worse by the fact that sometimes (not always) pressing enter while focusing IEs address-field does not reload the page either, so the reload-action is the only option to restart the application.
Comment 5 Ralf Sternberg CLA 2011-02-28 15:35:05 EST
It turned out that registering the concatenated javascript file as a resource (as suggested in bug 335545) fixes the problem for Safari on desktop and mobile. The servlet container sends Last-Modified and Etag headers, and Safari correctly adds If-Modified-Since	and If-None-Match headers to subsequent requests, receiving only a HTTP 304 "Not Modified" response.
Comment 6 Ralf Sternberg CLA 2011-11-13 15:37:18 EST
According to comment 5, this issue has been fixed together with bug 345120.