- 论坛徽章:
- 0
|
折腾很久了。。。
我想让Apache缓存一些页面,现在同一浏览器第二次访问同一页面时,是取的缓存里的数据,但是其它浏览器访问时,却要重新对该浏览器生成缓存。
也就是说,User-Agent几百种,一个URL就能生成几百份缓存。
怎么才能让一个URL只生成一份缓存呢?- Header unset Vary
- LoadModule cache_module modules/mod_cache.so
- <IfModule mod_cache.c>
- LoadModule disk_cache_module modules/mod_disk_cache.so
- # If you want to use mod_disk_cache instead of mod_mem_cache,
- # uncomment the line above and comment out the LoadModule line below.
- CacheDefaultExpire 86400
- CacheMaxExpire 178000
- CacheRoot /httpdcache
- CacheEnable disk /
- CacheDisable /static
- CacheDirLevels 4
- CacheDirLength 2
- CacheMaxFileSize 2000000
- CacheMinFileSize 1
- CacheIgnoreNoLastMod On
- CacheIgnoreHeaders Set-Cookie Cookie Referer Accept Accept-Charset Content-Type Accept-Datetime Authorization From If-Match Max-Forwards Via Warning Vary User-Agent Accept-Language Cache-Control Progma Keep-Alive Connection Host Accept-Encoding X-Requested-With
- CacheIgnoreCacheControl On
- </IfModule>
复制代码 |
|