简体   繁体   English

Apache 2.4 mod_cache + mod_cache_disk + modjk:304未修改,但内容长度已修改

[英]Apache 2.4 mod_cache + mod_cache_disk + modjk: 304 Not Modified, but Content-Length modified

I am getting crazy with mod_cache! 我对mod_cache感到疯狂!

My current setup: 我当前的设置:

Apache 2.4 on Ubuntu with: Ubuntu上的Apache 2.4,具有:
- mpm_worker -mpm_worker
- mod_jk -mod_jk
- mod_cache -mod_cache
- mod_cache_disk -mod_cache_disk
- mod_expires -mod_expires
- mod_deflate -mod_deflate

HTTP & HTTPS Request are balanced by modjk to 5 Tomcat AppServers. HTTP和HTTPS请求通过modjk平衡到5个Tomcat AppServer。 I want to cache media assets served by Tomcat Instances, but getting trouble with mod_cache. 我想缓存由Tomcat实例提供的媒体资产,但是在使用mod_cache时遇到了麻烦。

My current cache configuration: 我当前的缓存配置:

    CacheRoot /srv/volatile/cache
    CacheDirLevels 3
    CacheDirLength 2
    CacheEnable disk /medias

    # Currently active:
    CacheQuickHandler off
    CacheLock on
    CacheLockPath /tmp/mod_cache-lock
    CacheLockMaxAge 5
    CacheIgnoreHeaders Set-Cookie

    # This is another configuration i tried:
    #CacheIgnoreNoLastMod On
    #CacheIgnoreCacheControl On
    #CacheIgnoreQueryString On
    #CacheIgnoreHeaders Set-Cookie

I checked a lot of tutorials und guides, but without success. 我检查了很多教程和指南,但没有成功。

The first request is getting served fine by Apache, following request are failing with weird errors: Apache可以很好地满足第一个请求,之后的请求却失败,并出现奇怪的错误:

Recalled cached URL info header https://...
Recalled headers for URL https://...
Adding CACHE_SAVE filter for /medias...
Adding CACHE_REMOVE_URL filter for /medias...
cache: /media... responded with an uncacheable 304, retrying the request. Reason: contradiction: 304 Not Modified, but Content-Length modified
cache: Removing url https://
Deleting /srv/volatile/cache/.../.header from cache.
Deleting /srv/volatile/cache/.../.data from cache.
Deleting directory /srv/volatile/cache/.../7n from cache.
URL https://... failed the size check (0 < 1)

I thought that it could be a load balancing issue, because of walk threw multiple nodes or something like that, but the behavior isn't deterministic. 我认为这可能是负载平衡的问题,因为步行引发了多个节点或类似的事件,但是这种行为不是确定性的。 Tests with apache-bench & jmeter showed me that 60-70% of request failed, so that not exactly every X request failed. 使用apache-bench&jmeter进行的测试显示60-70%的请求失败,因此并不是每个X请求都失败。

If the CacheIgnoreCacheControl On option is set, requests threw jmeter & apache-bench didn't fail, but access threw Browser failed. 如果设置了CacheIgnoreCacheControl On选项,则请求引发的jmeter&apache-bench不会失败,但是访问引发的浏览器失败。

Someone any idea ? 有人知道吗?

Thanks Taulant 谢谢陶朗特

我认为,这已由mod_cache错误56881覆盖, 该错误已在Apache 2.4.11中修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM