参考来源:
http://www.lai18.com/content/433445.html
//检测有没改变 //edit http://www.lai18.com if (isset($_SERVER[‘HTTP_IF_NONE_MATCH‘])){ $etag = $_SERVER[‘HTTP_IF_NONE_MATCH‘]; if (md5($this->image) === $etag){ header("HTTP/1.1 304 Not Modified"); exit; } } header("Last-Modified: " . gmdate("D, d M Y H:i:s", strtotime(‘2011-1-1‘))." GMT"); //输出etag头 header(‘etag:‘ . md5($this->image)); header(‘Cache-Control:max-age=2592000‘);echo $this->image;
fastcgi_param CACHE_ETAG $http_if_none_match;
原文地址:http://blog.csdn.net/hello_katty/article/details/46580839