簡體   English   中英

我的Pragma HTTP響應標頭應設置為什么?

[英]What should my Pragma HTTP response header be set to?

我將與緩存相關的標頭設置為在八個小時后到期,如下所示...

header('Cache-Control: max-age=28800');
header('Expires:' . gmdate('D, d M Y H:i:s T', strtotime('+8 hours')));

在這種情況下,我的Pragma HTTP響應標頭應設置為什么?

您不必設置編譯指示,僅當您需要無緩存指令時才設置編譯指示。 在這里查看更多信息: http : //www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32

有關session_cache_limiter的信息,請參見PHP文檔。 您將看到要發送的正確的緩存頭:

上市:

Expires: (sometime in the future, according session.cache_expire)
Cache-Control: public, max-age=(sometime in the future, according to session.cache_expire)
Last-Modified: (the timestamp of when the session was last saved)

private_no_expire:

Cache-Control: private, max-age=(session.cache_expire in the future), pre-check=(session.cache_expire in the future)
Last-Modified: (the timestamp of when the session was last saved)

私人的:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=(session.cache_expire in the future), pre-check=(session.cache_expire in the future)
Last-Modified: (the timestamp of when the session was last saved)

非緩存:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM