【发布时间】:2012-05-23 15:46:14
【问题描述】:
我测试了我在this web site 上找到的这个脚本:
function setExpires($expires) {
header(
'Expires: '.gmdate('D, d M Y H:i:s', time()+$expires).'GMT');
}
setExpires(10);
echo ( 'This page will self destruct in 10 seconds<br />' );
echo ( 'The GMT is now '.gmdate('H:i:s').'<br />' );
echo ( '<a href="'.$_SERVER['PHP_SELF'].'">View Again</a><br />' );
当我刷新页面时,时间每隔 10 秒而不是 10 秒更新一次。
“如果我们点击此链接,我们会注意到时间仅每十秒更新一次”
【问题讨论】:
标签: php caching header http-headers