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
.
The cache manifest file is a simple text file that lists the resources the browser should cache for offline access.
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.
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.
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.
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:
mimeMap
entry under staticContent
in your web.config like <mimeMap fileExtension=".appcache" mimeType="text/cache-manifest" />
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