我正在尝试使用 mod_expires 将 Expire 标头设置为从访问 text/html 后 2 小时:
I am trying to set Expire header to 2 hours from access for text/html by using mod_expires like that:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 2 hours"
ExpiresByType text/html "access plus 2 hours"
</IfModule>
但是当与 PHP 一起使用时:
However when used with PHP:
session_start();
Expires 标头正在重置为:
Expires header is being reset to:
Expires: Thu, 19 Nov 1981 08:52:00 GMT
任何想法如何避免 session_start()
覆盖?
Any ideas how to avoid that overwrite by session_start()
?
好的,貌似找到答案了:
OK, looks like have found an answer:
session_cache_limiter('public');
session_start();
成功了,谢谢.
这篇关于PHP session_start() 覆盖 HTTP Expires 标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!