tags:

views:

61

answers:

1

Is it possible to add an entire folder of files to an HTML5 cache manifest file? I can't list all of the files in the folder individually because the files in this folder will be dynamically changing (it is a folder of images).

+1  A: 

If the folder is dynamically changing, then it should not be in the application manifest. If the folder changes, then there still needs to be some sort of link from the page to the files in the folder. The manifest should just list off those items.

For instance:

/images/
   1.jpg
   2.jpg
   3.jpg
   4.jpg

and the (simplified) HTML file:

<html manifest="http://foo.bar/cache-manifest"&gt;
<body>
<img src="images/2.jpg" />
<img src="images/4.jpg" />

Should have a manifest that looks like this:

CACHE MANIFEST
http://foo.bar/images/2.jpg
http://foo.bar/images/4.jpg

If you wanted to update the manifest file to include new items, you can simply add a URL parameter that changes when the contents of the folder (and the manifest) change:

<html manifest="http://foo.bar/cache-manifest?updated=8_23_2010_1_53_pm"&gt;

Whenever the manifest URL changes, it will be re-downloaded.

mattbasta