header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); // Date in the past
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
header( 'Cache-Control: no-store, no-cache, must-revalidate' ); // HTTP/1.1
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
header( 'Cache-Control: no-store, no-cache, must-revalidate' ); // HTTP/1.1
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );
本文介绍了通过PHP设置HTTP头部来控制浏览器缓存的方法,包括设置过期时间、最后修改时间及禁止缓存等策略。
375

被折叠的 条评论
为什么被折叠?



