简体   繁体   English

具有动态内容的网站实际上是否需要停止浏览器缓存?

[英]Do websites with dynamic content actually need to stop browser caching?

We always add nocache to our meta headers when dealing with dynamic content, but now that we're using html5, the old nocache meta tags are now invalid and we'll need to handle it via php headers. 在处理动态内容时,我们总是将nocache添加到我们的元头中,但是现在我们使用的是html5,旧的nocache元标记现在无效,我们需要通过php标头来处理它。 This got me thinking, why exactly do we even need to? 这让我开始思考,为什么我们甚至需要这么做?

Static content can be cached, stuff like images, document and fonts. 可以缓存静态内容,例如图像,文档和字体。

Dynamic content should not be cached, since that would present outdated views to the user. 不应该缓存动态内容,因为动态内容会向用户显示过时的视图。

Note, that a page always contains lots of static stuff alongside the little dynamic content. 请注意,页面总是包含大量静态内容以及少量动态内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM