Basic HTML5 Caching

I'm a bit slower caching HTML5, but I only have simple questions.

1) How long is the data stored in cached manifests?

2) . If I update the data, how can I make sure that the client checks for a newer version when it is available, or is it already done?

3) In addition, is it completely useless for a non-mobile environment or can it speed up boot time on the desktop?

<html lang="en" manifest="offline.manifest"> 

offline.manifest

 CACHE MANIFEST index.html style.css image.jpg image-med.jpg image-small.jpg notre-dame.jpg 
+4
source share
2 answers

1) While the user cares about caching. The only way to completely get rid of the cache is to go into your browser settings and explicitly delete it.

2) If you update the manifest file, the client will download new versions of all the files. This download is still governed by the "old" HTTP caching rules, so set the headers accordingly, also make sure you send the "no-cache" header in the manifest file itself. The rules from the HTML5 Boilerplate are probably a good place to start.

3) Remember that desktops can lose touch. In addition, the presence of files in the application cache means that they are always serviced locally, so if you are reasonable about what you put in it, the application cache can reduce bandwidth and latency. What I mean is reasonable: if most visitors see only a few pages of your site, and every week you update the manifest of your entire site, then they can use a lot of bandwidth if you force them to cache the load of static files for pages on which they never watch.

To really reduce the bandwidth and latency in your HTML5 website in the future: use the application cache for all your assets and static frameworks; use something like mustache to display all your content from JSON; send this JSON over Web Sockets instead of HTTP, saving ~ 800 bytes and two-way network acknowledgment upon request; cache data using Local Storage to save it again and control navigation using the history API .

+2
source

1) How long is the data stored in cached manifests?

When an application is cached, it remains cached until one of the following occurs: The user clears the browser cache. The manifest file is changed. The application cache is updated programmatically

2) If I update the data, how can I make sure that the client checks for a newer version when it is available, or is it already done?

you can specify witch files not for caching (NETWORK :) If you want to update your cached files, you have to change something in the manifest file, the best way is to put a comment in the file and change it when you want the browser to update the cache

3) In addition, is it completely useless for a non-mobile environment or can it speed up boot time on the desktop?

Yes, this is useful because the Internet can cut across all devices

0
source

All Articles