Return-Path: Delivered-To: apmail-incubator-trafficserver-user-archive@minotaur.apache.org Received: (qmail 31892 invoked from network); 24 Nov 2009 01:53:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Nov 2009 01:53:09 -0000 Received: (qmail 76493 invoked by uid 500); 24 Nov 2009 01:53:09 -0000 Delivered-To: apmail-incubator-trafficserver-user-archive@incubator.apache.org Received: (qmail 76441 invoked by uid 500); 24 Nov 2009 01:53:09 -0000 Mailing-List: contact trafficserver-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: trafficserver-user@incubator.apache.org Delivered-To: mailing list trafficserver-user@incubator.apache.org Received: (qmail 76432 invoked by uid 99); 24 Nov 2009 01:53:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2009 01:53:09 +0000 X-ASF-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mahakala@gmail.com designates 209.85.221.202 as permitted sender) Received: from [209.85.221.202] (HELO mail-qy0-f202.google.com) (209.85.221.202) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2009 01:53:06 +0000 Received: by qyk40 with SMTP id 40so3221662qyk.22 for ; Mon, 23 Nov 2009 17:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=W83Khcqk/o0JGiTIoVyTycQymbCDTa0gvS6XAvBJuuE=; b=ghwkSCdwNXVll1ob8GKFA4AsNfCJZC3ovRjjF+DmUzTKnRsTVWmMOy6gpED6a8tiY1 HCpkRj4DuCnx8YAvzwmfCicCKCfp+xZxSW+3T43EFe/NeXbN2MgHRfJNaJ1/d4Q3mvdb Uu09AG4jnyT+fdPdhIY5nDkw0MYl0U/IrO4Qo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RTE1EFL85hrOfVBDMEFBAVS2d16zRYZUUdikcc3EY1m5tC85hxOvMTIupDMeH+UAe+ UDP9I+tiupGE26fJU7Xl8t0MACtNHMsou2F+pI1hrcs7QJaUhd0CYIDLf1Nulua1Z59P bfq4HdXRSSFBQvgGRC7DgeF1lOSuDb0hgNUjc= MIME-Version: 1.0 Received: by 10.229.49.204 with SMTP id w12mr757632qcf.3.1259027565710; Mon, 23 Nov 2009 17:52:45 -0800 (PST) In-Reply-To: <4B0B000F.2050108@apache.org> References: <1c08b4490911221736q6c2935afx94cf9191e22d5e9b@mail.gmail.com> <29eef24f0911221807y266c3cd5o65416bf0f80a550@mail.gmail.com> <1c08b4490911221904w2e843e54n3f6bca23e93f1e8b@mail.gmail.com> <4B0B000F.2050108@apache.org> Date: Tue, 24 Nov 2009 09:52:45 +0800 Message-ID: <1c08b4490911231752v392cbc43p7dda6550660714c7@mail.gmail.com> Subject: Re: How to identify whether a object is cache hit from the response header From: mahakala To: trafficserver-user@incubator.apache.org Content-Type: multipart/alternative; boundary=0016364ee71ed10f7a04791432bb --0016364ee71ed10f7a04791432bb Content-Type: text/plain; charset=ISO-8859-1 On Tue, Nov 24, 2009 at 5:35 AM, Leif Hedstrom wrote: > On 11/22/2009 08:04 PM, mahakala wrote: > > > > On Mon, Nov 23, 2009 at 10:07 AM, Eric Balsa 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 > > Thanks, Leif, I am reading on it. Mahakala --0016364ee71ed10f7a04791432bb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Nov 24, 2009 at 5:35 AM, Leif He= dstrom <zwoop@apac= he.org> wrote:
=20
On 11/22/2009 08:04 PM, mahakala wrote:


On Mon, Nov 23, 2009 at 10:07 AM, Eric Balsa <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 e= asier to test if an object is in cache or not is to send a request header like this with the request:

=A0=A0=A0=A0 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

=A0=A0=A0 curl -s -o /dev/null -D - -H "Cache-Control: only-if-cached&= quot; http://...


Cheers,

-- leif


Thanks, Leif, I am reading on it.

Mahakala --0016364ee71ed10f7a04791432bb--