admin管理员组文章数量:1336632
In reviewing the answer to this post, I don't understand why 0 seconds is used for best practice here:
ExpiresByType text/html "access plus 0 seconds"
I think this means that whenever a user visits the website, the html page is always downloaded instead of pulled from cache. Is that right?
Is this what people typically set for this variable? If so why? If not, which scenarios benefit from setting it to 0 seconds?
In reviewing the answer to this post, I don't understand why 0 seconds is used for best practice here:
ExpiresByType text/html "access plus 0 seconds"
I think this means that whenever a user visits the website, the html page is always downloaded instead of pulled from cache. Is that right?
Is this what people typically set for this variable? If so why? If not, which scenarios benefit from setting it to 0 seconds?
Share Improve this question edited May 23, 2017 at 11:59 CommunityBot 11 silver badge asked Oct 30, 2013 at 20:27 ggkmathggkmath 4,25624 gold badges76 silver badges133 bronze badges1 Answer
Reset to default 9If text/html
only meant "content from static HTML files", you'd be right, and you'd want to set a longer cache life. But server-side scripts typically also return a web page; that is, their responses' Content-Type will often be text/html
as well. And if all HTML were cached, dynamically generated content might not appear to update properly.
If you wanted to expire only non-static HTML, you might be able to do something like
<FilesMatch "\.php$">
ExpiresByType text/html "access plus 0 seconds"
</FilesMatch>
(using PHP as an example).
本文标签:
版权声明:本文标题:javascript - why would anyone set (Apache mod_expires parameter) ExpiresByType to "access plus 0 seconds"? - S 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742412469a2470062.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论