Drop current page from standalone HTML5 appcache but use cached resources

To improve performance, I want some of my web pages to use resources that were cached for offline use (images, CSS, etc.), but should not be cached by the page itself, because the content will be generated dynamically.

One way to do this is to reorganize my pages so that they load dynamic content through AJAX or view things in LocalStorage. Details may vary, but overall, something like that.

If possible, I would prefer to find a way to simply tell the browser to use cached resources (again images, CSS, etc.) for the page, but not actually cache the (dynamically generated) HTML content itself.

Is there a way to do this using standalone HTML5 appcache? I get the impression that the answer is no, because:

  • Any page containing a manifest will be cached, so I cannot specify cached resources on the page itself.
  • It is not possible to tell the previous page to "use offline resources for this other page, but not actually cache the HTML on this page." You must specify the page itself, which means that HTML will be cached.

Am I really wrong? There seems to be some tricky (or not so tricky) way around this. Now that I typed it, I wonder if the included page will explicitly do the trick in the NETWORK section of the appcache manifest.

+7
source share
3 answers

My answer is yes".

I worked on a web application where I listed all the necessary resources in the manifest and set the NETWORK section to * .

the manifest is then only included on the main landing page. Thus, all resources are cached on the first visit to the site, and it works with pleasure.

In short,

  • one of your pages must include a manifest and therefore will be cached.

    perhaps you can have a manifest loaded in an iframe and not cache the whole page, just a thought.

  • specify all your resources that will be cached in the CACHE section

  • set the NETWORK section to *
+7
source

I am sure that the answer to this question is no. If you use the Network section in Chrome, it shows what resources are downloaded from the cache and downloaded from the server. I tried installing appcache as described above, and resources are always loaded from the server. Would I be right to assume that if the current page is not in appcache, then it will not try to check in appcache for any of the resources?

+2
source

What I found that works is a list of those files that you do not want to cache in appcache in the NETWORK: section. For me, this meant adding * .asp * to the network section. Now none of the classic asp files or aspx files are cached.

0
source

All Articles