- Progressive Web Application Development by Example
- Chris Love
- 146字
- 2021-08-05 10:33:18
Referencing the web manifest file
The web manifest file must be referenced in the document's HEAD, as mentioned in the following code:
<head> .... <link rel="manifest" href="manifest.json"> </head>
Manifests should be served using the application/manifest+json MIME type. This is an important setting because it is often overlooked.
You should research how to define or add MIME types in your web server of choice.
Many servers block requests to files based on their type by default. This often leads to manifest files returning 404 or 403 type status codes. I see similar issues raised when PDF documents need to be served. You may need to coordinate with your network administrators or devops team to make sure that your servers are properly configured.
Do not cache the web manifest file using your service worker. You may not be able to update the file without updating your service worker. They should remain decoupled.
推薦閱讀
- 網絡云百問百答
- 計算機網絡與通信(第2版)
- Building Django 2.0 Web Applications
- Learning QGIS 2.0
- WordPress 5 Complete
- Wireshark網絡分析就這么簡單
- Microservice Patterns and Best Practices
- 計算機網絡技術及應用
- 網絡工程實施技術與方案大全
- 網絡空間全球治理觀察
- Professional Scala
- 數字王國里的虛擬人:技術、商業與法律解讀
- Enterprise ApplicationDevelopment with Ext JSand Spring
- ReasonML Quick Start Guide
- 路由與交換技術