亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP cannot use header cache
歐陽(yáng)克
歐陽(yáng)克 2017-06-30 09:56:14
0
1
823
<?php
header("Cache-Control: public");
header("Pragma: cache");
$offset = 30*60*60*24; // cache 1 month
$ExpStr = "Expires: ".gmdate("D, d M Y H:i:s", time() + $offset)." GMT";
header($ExpStr);
echo date("Y-m-d l H:i:s A");
?>

I set up a cache for one month, but the display time is different every time I refresh it. What's wrong with the code?

歐陽(yáng)克
歐陽(yáng)克

溫故而知新,可以為師矣。 博客:www.ouyangke.com

reply all(1)
劉奇

Every time the page is refreshed, you send the Header, and of course it is updated every time.

If there is a cache header on the http header,
When the browser requests this page, it will bring request headers such as If-Modified, If-Match, etc.
You need to judge based on the content in the If header, yes Send 304 Not Modified or send a new page.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template