我有这个设置在我的000默认:
<VirtualHost 192.168.1.10:80> ServerName live.website.com DocumentRoot /var/www/live.website.com SetOutputFilter INFLATE;proxy-html;DEFLATE CacheEnable mem http://live.website.com/ MCacheSize 4096 MCacheMaxObjectCount 1000 MCacheMaxObjectSize 2048 CacheDefaultExpire 3600 CacheMaxExpire 3600 CacheStoreNoStore On CacheStorePrivate On CacheIgnoreCacheControl On CacheIgnoreNoLastMod On MCacheMaxStreamingBuffer 2097152 </VirtualHost>
这个页面http://live.website.com/index.php
只打印: time()
,但是我看到10秒后这个时间被重新caching了。
也试过磁盘,但我得到了相同的结果。
Ubuntu +灯最新。
谢谢
一个普通的PHP脚本需要包含额外的HTTP头信息,以使mod_cache
可以工作。 请参阅Apache 高速caching指南中的 “ 可以caching什么? ”一节。
<?php header("Cache-Control: must-revalidate, max-age=3600"); header("Vary: Accept-Encoding"); echo time();