Pragma no cache and javascript

末鹿安然 提交于 2020-01-03 03:02:05

问题


Does the pragma no-cache mean the browser will not cache javascript scripts?

e.g. Will the pragma no cache tag stop the browser from caching the jquery script?


回答1:


Actually, that depends on the browser used. For modern browsers you need to add Cache-Control and Expires headers as well.

response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);

See also:

  • How to control web page caching, across all browsers?


来源:https://stackoverflow.com/questions/6208715/pragma-no-cache-and-javascript

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