Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338412 - Safari does not cache JsLibraryServiceHandler request
Summary: Safari does not cache JsLibraryServiceHandler request
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5 M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 345120
Blocks: 323032 338647
  Show dependency tree
 
Reported: 2011-02-28 09:03 EST by Ralf Sternberg CLA
Modified: 2011-11-13 15:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.