开发者

iPhone webapp: my ressources don't get cached

开发者 https://www.devze.com 2022-12-30 19:47 出处:网络
First of all, I\'d like to say I\'m not using any off-line feature from HTML5. I have a we开发者_开发问答b-application which runs on the iPhone. When viewing it from safari, everything works quite we

First of all, I'd like to say I'm not using any off-line feature from HTML5.

I have a we开发者_开发问答b-application which runs on the iPhone. When viewing it from safari, everything works quite well.

But when I launch the application from the home screen (to remove the navigation bar), it can be really slow.

I checked the logs in Apache and it appears that Safari does a good work to cache the resources (css / js / images), with Apache answering "304 Not Modified" when needed.

However, when the web app run as a "real" application (navigation bar hidden), those resources doesn't get cached and Apache the content has to be transferred over and over again (response code 200 Ok + content), resulting in a significantly slower page load.

How can I prevent this behavior? Do I need to always run my webapp inside Safari, even when it's launched from the home screen?

Thank you!


I finally used the HTML off-line storage with a cache.manifest file. This half-solved my problem, because images which are not included in the cache manifest still don't get cached (And I don't know those files in advance, because they are included from a CMS, so this could be anything). Still, that's way better for the loading time.

0

精彩评论

暂无评论...
验证码 换一张
取 消