简体   繁体   English

应用程序缓存错误事件:清单提取失败(404)

[英]Application Cache Error event: Manifest fetch failed (404)

I have a simple html website containing one css and js doc and some images. 我有一个简单的HTML网站,其中包含一个CSS和JS文档以及一些图片。 I need to make this work offline.I use html 5 offline cache for this purpose. 我需要使这项工作脱机。为此,我使用html 5脱机缓存。 On deploying and browsing i see that the website doesnt cache.Console shows an error : Application Cache Error event: Manifest fetch failed (404) 在部署和浏览时,我看到网站没有缓存。控制台显示错误: 应用程序缓存错误事件:清单提取失败(404)

Following are the details : Directory structure : 详细信息如下:目录结构: 在此处输入图片说明

Manifest file : 清单文件:

在此处输入图片说明

Whats wrong? 怎么了?

The file name must be manifest.appcache ; 文件名必须为manifest.appcache; it should not contain names of files other than images/javascript/css/html files. 它不应包含images / javascript / css / html文件以外的文件名。 Any other types will result in error in fetching files. 任何其他类型都将导致提取文件时出错。 The rule applied to offline caching is ~ 'catch all or none'. 应用于离线缓存的规则是〜'catch all or none'。

If you are caching mobile data on iPhone, please check the filename since, according to Apple Docs it must be cache.manifest : 如果要在iPhone上缓存移动数据,请检查文件名,因为根据Apple Docs,文件名必须为cache.manifest

Storing Data on the Client 在客户端上存储数据

It's already 2019 and I had the very same error message =) 已经是2019年了,我有非常相同的错误消息=)

For me renaming the file as manifest.appcache made it work. 对我来说,将文件重命名为manifest.appcache使其可以工作。

In any case, digging further about this error, I found the AppCache API is deprecated (I'm new to these APIs, since I started studying about PWA recently) and no longer recommended (Use CacheStorage + ServiceWorkers instead) https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache 无论如何,进一步研究此错误,我发现AppCache API已被弃用 (由于我最近开始研究PWA ,所以我不熟悉这些API) ,不再推荐 (改用CacheStorage + ServiceWorkershttps:// developer .mozilla.org / EN-US /文档/网页/ HTML / Using_the_application_cache

Hope this info can help others on the same path =) 希望此信息可以帮助其他人=)

Did you try example.manifest.php? 您是否尝试过example.manifest.php? instead of .txt? 而不是.txt?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM