Playing with AppCache for offline page access
Some links to useful resources:
- How to use
Expiresin your headers/.htaccess file to ensure the browser regularly checks the manifest
- How to use
- Remember your appcache file needs the text/appcache mimetype
AddType text/cache-manifest .appcachein Apache
Here are my
.htaccess file additions for the directory which is utilizing appcache (http://sagar.org/qrc/):
. . . AddType text/cache-manifest .appcache ExpiresActive On ExpiresByType text/cache-manifest "access plus 0 seconds"
Adding an appcache manifest
The manifest file tells the browser which resources from the site to cache locally. The manifest is referenced via an attribute in the landing page's
<html ... > tag.
Remember: the appcache must be of content-type
NOTE: unless the manifest changes, none of the referenced files will ever again be fetched from the server. That's the sole purpose of the comment line (see that "
#" means comment) in the manifest. I can change it when I want to invalidate a browsers downloaded version of the website/webapp. Only when the manifest is modified will it's contents be re-examined and (if necessary) re-downloaded.
CACHE MANIFEST # 2014-05-30 v0.1 CACHE: /qrc/index.html /qrc/sagarorg_qrc.png FALLBACK: /qrc/ /qrc/index.html