Tuesday, July 22, 2008

PHP配合Squid缓存动态页面Header写法


function nocache_headers() {
// @ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// @ header('Expires: Wed, 11 Jan 2009 05:00:00 GMT');
@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
if(PAGEME=="bookinfo"){
@ header('Expires: ' . gmdate ("D, d M Y H:i:s", time() + 3600*24). " GMT");
}else{
@ header('Expires: ' . gmdate ("D, d M Y H:i:s", time() + 3600). " GMT");
}

// @ header('Cache-Control: no-cache, must-revalidate, max-age=0');
// @ header('Pragma: no-cache');

// @ header('Cache-Control: no-cache, must-revalidate, max-age=0');
// @ header('Pragma: no-cache');
}

1 comment:

  1. disque dur ssd...

    PHP配合Squid缓存动态页面Header写法 | Fred Chu...

    ReplyDelete