Does meta tag no-cache prevent router caching?

2019-04-07 01:46发布

I have the following meta tags that supposedly prevents browser caching

<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />

Does this prevent a caching server from holding the content as well, if it doesn't, is there a way to prevent router/server caching?

标签: caching
3条回答
小情绪 Triste *
2楼-- · 2019-04-07 02:28

It is supposed to prevent that. If the writers of the caching server have written it to respect these tags.

There is no guarantee that this will be respected, but a well written caching server that follows standards should respect these tags.

查看更多
不美不萌又怎样
3楼-- · 2019-04-07 02:29

from here

Why META Cache Controls Don't Always Work

Note that the META tags in our example both used the HTTP-EQUIV attribute, which tries to mimic HTTP header information. HTTP headers control how both browser and proxy caches handle your Web pages. They are invisible in HTML and usually generated automatically by your Web server.

You are better off using HTTP headers for setting the cache property. References

http://support.microsoft.com/kb/234067

http://www.htmlgoodies.com/beyond/reference/article.php/3472881

查看更多
够拽才男人
4楼-- · 2019-04-07 02:41

No, it won't prevent proxy caching, and neither will any meta tag. You need to send the HTTP header Cache-Control: no-cache.

http://www.w3.org/Protocols/HTTP/Issues/cache-private.html

See also: http://www.mnot.net/cache_docs/#META

查看更多
登录 后发表回答