Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load cache manifest file

How to make server to return manifest file with text/cache-manifest content type? By default, if I put it to the server and include into <html manifest="cache.manifest"> it is being loaded with type application/x-ms-manifest.

like image 536
Sergey Metlov Avatar asked Aug 19 '11 07:08

Sergey Metlov


People also ask

What does cache do in manifest file?

The cache manifest file is a simple text file that lists the resources the browser should cache for offline access.

Should manifest JSON be cached?

Yes you should cache your manifest. json file, because if you a building a PWA, then it must have a functionality to Add to home screen . In your manifest file, it contains a start_url that needs to be cached by service worker and should return a 200 response when offline.

What is an application cache?

The Application Cache (AppCache) lets web-based applications run offline. Developers can specify resources for the browser to cache, making them available to the application even if no connection can be made to the server.

What is html cache?

Application Cache in HTML5: The current version of HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection. Now we can make an offline web application that will run without an internet connection by just creating a manifest file in our application.


1 Answers

That's one of the reasons why the recommended extension for manifest files is now .appcache - Microsoft is already using .manifest for something else. To configure content types:

  • In IIS6 and below, add the MIME type mappings on the header tab of your virtual directory or web site properties (MS instructions).
  • In IIS7 and later, either go to MIME types in Features view or add a mimeMap entry under staticContent in your web.config like <mimeMap fileExtension=".appcache" mimeType="text/cache-manifest" />
like image 81
robertc Avatar answered Sep 22 '22 18:09

robertc