问题是代理内容被Apache 2.4caching。
这个问题已经解决了Apache 2.2 (即使用mod_mem_cache)。 但是在Apache 2.4中, mod_mem_cache被删除了 。
我的上游内容来源是http://10.1.1.123:8081/data/ ,它在Apache中是这样configuration的:
Alias /data /var/www/html/index.php
数据index.php的工作原理是这样的:
root@orac:/var/www/html# cat index.php <?php $expires = time() + 5; $expires = gmdate( 'D, d MYH:i:s', $expires ) . ' GMT'; header( 'Content-Type: text/html; charset=utf-8' ); header( "Expires: {$expires}" ); echo $expires;
即自请求后的五秒钟后到期内容。
如果我直接(从我的Web浏览器)访问/数据的五个caching工作。
在Apache中,我的代理configuration如下所示:
ProxyPass /cache/ http://10.1.1.123:8081/data/ ProxyPassReverse /cache/ http://10.1.1.123:8081/data/
而我的cachingconfiguration如下所示:
CacheEnable disk / CacheRoot "/var/cache/mod_proxy" CacheDirLevels 3 CacheDirLength 5 CacheIgnoreCacheControl On CacheMaxFileSize 100000000 CacheIgnoreNoLastMod O
caching存储可通过www-data进行写入:
root@orac:/var/cache/mod_proxy# ls -al total 8 drwxr-xr-x 2 www-data www-data 4096 Jun 5 13:41 . drwxr-xr-x 19 root root 4096 Jun 5 13:41 ..
任何人都可以帮我解决这个问题吗?