The link has a full explanation with more detail about how this all works, as well as an example of it in action. This is just going to be the short-short version. If you have any questions check that out, if you still have questions then leave a comment and I'll help you as best I can.
First we need to define a cache manifest, to do that you simple need to add a cache manifest item to your initial HTML tag. The proper extensions is .appcache, check the first section of the source to see an example.
Then, if the server isn't set up to support the .appcache file we need to add a line to out .htaccess file, this is important because it must be servered with the proper header. See the second section for the line to add to the htaccess file.
The we need to add the files to be cached to the appcache, there is a more complete example at the link, this is just the basic format. It's in the third section below.
If you have any questions or problems implementing leave a comment and I'll help you if I can.
- <!-- The manifest added to the opening html tag -->
- <html lang="en" manifest="cache.appcache">
- <!-- The line to add to the htaccess file -->
- AddType text/cache-manifest .appcache
- <!-- The contents of the cache.appcache file -->
- CACHE MANIFEST
- # list of every file to cache
- # note that you can't like to remote ssl served files like this one except in chrome
- # link of fallback files, in the format "original fallback"
- otherpage.html offline.html
- # for a catch all, use a simple slash like this
- / offline.html
You need to login to post a comment.