现在我用了比较快的WordPress Batcache缓存方案,并且将Batcache缓存时间调整了,这与h5b的server-configs-apache缓存方案是否有冲突?下面是网站首页得到的请求HTTP HEADER:
Cache-Control: max-age=2839, must-revalidate, max-age=2592000, no-transform Connection: close Content-Encoding: gzip Content-Length: 29680 Content-Type: text/html; charset=UTF-8 Date: Sat, 21 Nov 2020 09:28:36 GMT Expires: Mon, 21 Dec 2020 09:28:36 GMT Last-Modified: Sat, 21 Nov 2020 09:15:55 GMT Server: Apache Vary: Cookie,Accept-Encoding
可以发现有两个max-age
,第一个是batcache的设置的缓存时间,并且是倒计时的,会逐渐缩短。第二个max-age=2592000
我算了下,刚好是一个月,这个是由于h5bp默认用了1个月的缓存方案,在cache_expiration.conf
文件中可以看到:
ExpiresActive on ExpiresDefault "access plus 1 month"
将其改为
ExpiresActive on #ExpiresDefault "access plus 1 month"
然后重启apache即可。