Commit efe26765 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5: fix - check cache hit say HIT when STALE

When Apache Traffic Server say "[cSsSfU]" in "Via" header,
"cS" means the cache served a new content (~= cache miss)
parent 3916d69e
...@@ -191,7 +191,7 @@ output = ${buildout:directory}/template-http-monitor.cfg.in ...@@ -191,7 +191,7 @@ output = ${buildout:directory}/template-http-monitor.cfg.in
< = download-base < = download-base
url = ${:_profile_base_location_}/monitor-templates/monitor-check-cache-hit.in url = ${:_profile_base_location_}/monitor-templates/monitor-check-cache-hit.in
download-only = true download-only = true
md5sum = 8fa7cad311d1c525bca7eb66cda4874c md5sum = 878833710ffd2e0734989cb9c93a8103
filename = monitor-check-cache-hit.in filename = monitor-check-cache-hit.in
mode = 0644 mode = 0644
......
...@@ -84,7 +84,7 @@ def do_request(url): ...@@ -84,7 +84,7 @@ def do_request(url):
m = Message(response_headers) m = Message(response_headers)
# see http://labs.omniti.com/people/mark/ats_sa/slides.html#slide-18 # see http://labs.omniti.com/people/mark/ats_sa/slides.html#slide-18
if any("[cHs" in header or "[cSs" in header for header in m.getheaders('via')) or \ if any("[cHs" in header for header in m.getheaders('via')) or \
any("HIT" in header for header in m.getheaders("x-cache")): any("HIT" in header for header in m.getheaders("x-cache")):
debug("Cache hit found in 'Via' or 'X-Cache' headers") debug("Cache hit found in 'Via' or 'X-Cache' headers")
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment