I'm building an offline web application and want to use cache-manifest. Currently my cache-manifest looks like this:
CACHE MANIFEST
# Change the version number below each time we update a resource.
# Rev 1
index.html
photo.html
js/photo.js
css/photo.css
http://code.jquery.com/jquery-1.6.1.min.js
http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js
http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css
http://maps.google.com/maps/api/js?sensor=false&region=GB
Is there any reason not to include external, CDN-hosted jQuery, jQuery Mobile and Google Maps files in the cache-manifest?
I can't think of one, but I thought I would ask those wiser than myself :)
Which is not the section of manifest? Explanation: If the files are not in cache they come from a list of the files in the network. Cache is the default section.
The CACHE section contains files you want to load and store on the user's machine. The first time the user loads your app, the browser will store all the files in the CACHE section of your app cache manifest.
A manifest can have three distinct sections: CACHE , NETWORK , and FALLBACK . CACHE: This is the default section for entries. Files listed under this header (or immediately after the CACHE MANIFEST ) will be explicitly cached after they're downloaded for the first time.
Yes. Actually, you must include external images in your manifest, or some browsers will not load them at all even if a network connection is available! (Unless you provide a NETWORK section, which may cause the images to be fetched every time, bypassing the regular browser cache.)
The images will be cached (at least by Firefox, didn't test Chrome).
The spec explicitly says:
Offline application cache manifests can use absolute paths or even absolute URLs
http://manifest-validator.com/ also reports a manifest with external URLs as OK.
I am not 100% sure this also applies to scripts, but a quick test with Firefox looked like the script is cached as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With