trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Hedstrom <zw...@apache.org>
Subject Re: How to identify whether a object is cache hit from the response header
Date Mon, 23 Nov 2009 21:35:11 GMT
On 11/22/2009 08:04 PM, mahakala wrote:
>
>
> On Mon, Nov 23, 2009 at 10:07 AM, Eric Balsa <ericb@apache.org 
> <mailto:ericb@apache.org>> wrote:
>
>     You should be able to look at the Via: header that TS inserts on each
>     response. Inside the [ ] there are a set of characters. You can view
>     the translation of the characters in:
>
>     cat traffic/trunk/proxy/http2/HttpTransact.h search for ViaString_t
>


There's also a README for the the response Via: header 
"encoding",./proxy/http2/README.via. However, maybe even easier to test 
if an object is in cache or not is to send a request header like this 
with the request:

      Cache-Control: only-if-cached


If the requested URL can be served out of cache, you'll get a 200 OK. If 
not, you'll get a 504 response (I think). With command line curl, 
something like

     curl -s -o /dev/null -D - -H "Cache-Control: only-if-cached" http://...


Cheers,

-- leif


Mime
View raw message