从PHP缓存头 [英] caching headers from PHP
问题描述
在PHP中,默认情况下没有缓存相关的头被发送。
In PHP, by default no cache related headers are sent.
HTTP/1.1 200 OK
Date: Fri, 19 Nov 2010 11:02:16 GMT
Server: Apache/2.2.15 (Win32) PHP/5.2.9-2
X-Powered-By: PHP/5.2.9-2
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 26
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
现在,因为默认情况下它并没有说明任何缓存,可以把它导致在某些情况下说example.com/index.php得到缓存?
Now, since by default it does not say anything about caching, can it result in say example.com/index.php getting cached in some situations?
推荐答案
是的。一般情况下,每一个成功的响应可能会被缓存除非有一些约束:
Yes. In general, every successful response may be cached unless there are some constrains:
除非明确由一个缓存控制约束( 14.9节)指令,缓存系统可以始终保存成功响应(见的作为缓存条目部分13.8 ),可以返回它而不验证它是否是新鲜的,并成功验证后可能返回。
Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entry, MAY return it without validation if it is fresh, and MAY return it after successful validation.
这篇关于从PHP缓存头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!