Use wildcard in cache scope in appcache

I want to use appcache to view my application offline and I want to use it like

CACHE MANIFEST

CACHE:
http://cdn.example.com/s/*

NETWORK:
*

      

is there any way the browser will cache all files in the 's' folder, and if not, then I can specify all the files of a particular folder or links to be included in the cache.

+3


source to share


2 answers


No, you cannot use wildcards in the CACHE section .



In the example above, try uploading a file named *

to a folder s/

on cdn.example.com

on page load.

+1


source


Depends on whether you want to explicitly cache all the pages in that folder, or just cache them based on lazy loading (i.e. if the user navigates to one of the pages, it will then be cached for future use).

If you want to cache all pages up, you have to list them all in the cache app manifest - I don't believe the template will work.



If you are happy that the page will only be cached after the user has visited it, you do not need to specify the page in the manifest, you just need to link the manifest on the appropriate page and it will be cached when it is visited.

You can read more here: http://diveintohtml5.info/offline.html

0


source







All Articles