<?php ob_start('ob_gzhandler'); header("Cache-Control: public"); header("Pragma: cache"); $offset = 60*60*24*60; $ExpStr = "Expires: ". gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; $LmStr = "Last-Modified: ". gmdate("D, d M Y H:i:s", filemtime( __FILE__))." GMT"; header( $ExpStr); header( $LmStr); header('Content-Type: text/javascript; charset: UTF-8'); ?>
这段代码我试过了,真的快了很多。推荐了。