Chrome doesn't cache file download as attachement (Content-Disposition = attachment; filename=one.pdf)

瘦欲@ 提交于 2020-01-14 10:42:50

问题


A rest endpoint that download a generated pdf file, where the response headers set are:

Cache-Control = public, max-age=600
Content-Disposition = attachment; filename=one.pdf

(also content-length, pragma, content-type = application/pdf are set)

In IE 11 and latest firefox the browser caching works(i.e I can see the pdf url in firefox cache - about:cache). I also checked that server is not hit for the time specified at max-age. In chrome I can find the pdf url in cache - chrome://cache, only when I set Content-Disposition inline(open it in a new tab).

Does anyone know why caching is not working in Chrome when content disposition value is attachment? Is this an intended behaviour?

来源:https://stackoverflow.com/questions/46273523/chrome-doesnt-cache-file-download-as-attachement-content-disposition-attachm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!