湘辣社区's Archiver

http://bbs.xiangyin.net

烟酒生 发表于 2009-2-5 13:41

用于处理缓存的样例 PHP 代码

<?php
  //
  // Emit headers before any other content
  //
  cache_control( "public,max-age=10");
  expires( to_gmt( time() + 10 ) );
?>
<html>
  <head>
  </head>
  <body>
    <?
     print to_gmt();
    ?>
  </body>
</html>
<?php
  function to_gmt( $now = null ) {
    return gmdate( 'D, d M Y H:i:s',  ( $now == null ) ? time() : $now );
  }
  function last( $gmt ) {
    header("Last Modified: $gmt");
  }
  function expires( $gmt ) {
    header("Expires: $gmt");
  }
  function cache_control( $options ) {
    header("Cache-Control: $options");
  }
?>

豆花壳 发表于 2009-3-21 22:20

看到如此好帖,怎么能不顶呢?

看到如此好帖,怎么能不顶呢?















[img]http://www.domain.cn/club/images/default/sigline.gif[/img]
有了天才不用,天才一定会衰退的,而且会在慢性的腐朽中归于消灭。---[url=http://www.morui.com/book/5/5680/]魔兽剑圣异界纵横[/url]
真正的人生,只有在经过艰难卓绝的斗争之后才能实现。---[url=http://www.shucheng.com/book/1/1928/]斗罗大陆[/url]
一个人的真正伟大之处就在于他能够认识到自己的渺小。---[url=http://www.u9uu.com/book/2/2636/]凡人修仙传[/url]

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.