Pragma没有缓存和JavaScript [英] Pragma no cache and javascript

查看:180
本文介绍了Pragma没有缓存和JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译指示否缓存意味着浏览器不会缓存JavaScript脚本?

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

例如。


编译指示缓存标记是否停止浏览器缓存jquery脚本?

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

推荐答案

<其实,这取决于使用的浏览器。对于现代浏览器,您需要添加 Cache-Control Expires 标题。

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?
    • 这篇关于Pragma没有缓存和JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆