开发者

Pragma no cache and javascript

开发者 https://www.devze.com 2023-03-10 06:37 出处:网络
Does the pragma no-cache mean the browser will not cache javascript scripts? e.g. Will the pragma no cache ta开发者_开发百科g stop the browser from caching the jquery script?Actually, that depends

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

e.g. Will the pragma no cache ta开发者_开发百科g stop the browser from caching the jquery script?


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?
0

精彩评论

暂无评论...
验证码 换一张
取 消