缓存离线应用的下载

时间:2014-07-10 01:10:23

标签: html5 caching offline

我正在建立一个具有离线功能的网站。我在各种缓存中缓存各种内容(localStorage中的JSON,常规HTTP缓存中的图像,应用程序缓存中的网站本身等)。

唯一的问题是文件下载。我希望用户至少下载一次的文件在用户离线时仍可通过HTTP缓存使用 - 即我想从缓存中提供下载。

但无论我尝试什么,例如:

Cache-Control:       max-age=86400, private
Content-Disposition: attachment; filename="presentation.pptx"
Content-Length:      128000
Content-Type:        application/vnd.openxmlformats-officedocument.presentationml.presentation
Server:              Microsoft-IIS/8.0

当我离线并请求下载文件时,网站仍会尝试访问在线网站(并失败)。

任何解决方案?它有可能吗?

提前谢谢。

0 个答案:

没有答案