Application Cache manifest

Phillip Senn picture Phillip Senn · Nov 16, 2011 · Viewed 17.3k times · Source
<!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?

Answer

robertc picture robertc · Nov 17, 2011

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: