3 ms·
The browser caches assets like that automatically. Alternatively, if you want to have a more install-like install, you might have luck with local storage: http
by maggit 15y ago
The browser caches assets like that automatically.
Alternatively, if you want to have a more install-like install, you might have luck with local storage: http://diveintohtml5.org/storage.html http://diveintohtml5.org/storage.html
Local storage seems to currently max out at 5 MB, but that's easy for the browser vendors to change if they see the need.
- azakai 15y agoYou can't rely on the browser cache, it is limited in size and depends on other websites as well. Localstorage is useful, but as you say limited. The real solution is IndexedDB. Partial (but useful already) support is in Firefox and Chrome. Other browsers are expected to follow soon.
- bajsejohannes 15y ago> You can't rely on the browser cache, it is limited in size and depends on other websites as well. And as if that wasn't enough, browsers don't trust expiration dates in HTTP, either. Press reload enough times, and all resources will be reloaded.
- simias 15y agoCache size is (fortunately) limited, and I wouldn't want a webapp to be able to store 100+MB of data in local storage without explicitely asking for my consent beforehand.
- MatthewPhillips 15y agoThis hits on one of the biggest obstacles to people perceiving web apps as "real apps". Most web pages feel, and in actually are, very disposable. You read an article at a site once, you don't want those assets to persist on your hard drive where they'll never be reused. Many people clear their caches regularly. What we need is a way for a site to say "i'm an app" which will tell the browser to store the cache in a separate bucket. Then when users go to clear their cache, there is a separate checkbox for web apps which is uncheck by default (just how passwords are unchecked by default). This is what Mozilla should be working on with it's web apps project. The installation part is just mascara. We need the browsers to do the distinguishing, not users.
- mnutt 15y agoThis sounds like a good idea, but as someone who runs a website, why wouldn't I say that it's an app even if it isn't?
- MatthewPhillips 15y agoGood point. The obvious answer is to prompt the user when a website says it's an app and wants to use special storage options. But wording that might be difficult to prevent confusing the user. It's not as easy to understand as "this website want to use your geolocation" or "this website wants to send you notifications".
- marshray 15y agoI think I heard this was going to be a feature of HTML 5.
- nkassis 15y agoI think this is what is being planned. Browser will ask you if you want to allow the app to use local storage (and hopefully give it a limit). If not large webgl games are going to be a pain if you have to wait 30 minutes to play. I'm not saying 10Gb but 1-2 might not be a bad limit.