<!DOCTYPE HTML>
<html manifest="example.appcache">
<link rel="stylesheet" type="text/css" href="AppCache.css">
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<p>Test to make sure css is being cached</p>
<img src="large.jpg">
<script src="AppCache.js"></script>
</body>
</html>
My example.appcache file has:
# v1 11/16/2011
AppCache.htm
AppCache.js
AppCache.css
large.jpg
The first time I navigated to the page, it asked
This website is asking to store data on your computer for offline use.
When I take Firefox offline and press refresh, the jpg disappears.
Q: What do I need to do to make sure the image is cached locally?
The cache manifest file is a simple text file that lists the resources the browser should cache for offline access.
Cached data helps apps load faster by keeping temporary files such as thumbnails, scripts, and video snippets on your phone instead of loading them from the web each time. But cached data can quickly fill up your phone's storage.
What is Application Cache? HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection. Application cache gives an application three advantages: Offline browsing - users can use the application when they're offline. Speed - cached resources load faster.
Once an application is cached, it remains cached until one of the following happens: The user clears the browser's cache. The manifest file is modified. The application cache is programmatically updated.
IIS does not serve unknown file types. You need to configure it to serve .appcache
files with the MIME type text/cache-manifest
, how you do this depends on which version of IIS you have:
mimeMap
element in web.config
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