Return-Path: Delivered-To: apmail-trafficserver-users-archive@www.apache.org Received: (qmail 75488 invoked from network); 31 Dec 2010 03:48:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Dec 2010 03:48:30 -0000 Received: (qmail 33615 invoked by uid 500); 31 Dec 2010 03:48:30 -0000 Delivered-To: apmail-trafficserver-users-archive@trafficserver.apache.org Received: (qmail 33447 invoked by uid 500); 31 Dec 2010 03:48:28 -0000 Mailing-List: contact users-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@trafficserver.apache.org Delivered-To: mailing list users@trafficserver.apache.org Received: (qmail 33439 invoked by uid 99); 31 Dec 2010 03:48:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Dec 2010 03:48:27 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [71.6.165.248] (HELO kramer.ogre.com) (71.6.165.248) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Dec 2010 03:48:19 +0000 Received: from [192.168.201.36] (c-24-8-250-209.hsd1.co.comcast.net [24.8.250.209]) (authenticated bits=0) by kramer.ogre.com (8.14.3/8.14.3) with ESMTP id oBV3lvUN012848 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Thu, 30 Dec 2010 19:47:58 -0800 X-DKIM: Sendmail DKIM Filter v2.8.3 kramer.ogre.com oBV3lvUN012848 References: <1293761559.6725.8.camel@zym6400> In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary=Apple-Mail-6--220027436 Message-Id: <5ACB72B1-37C3-45DC-88B1-2E96D160845B@apache.org> Cc: "users@trafficserver.apache.org" X-Mailer: iPhone Mail (8C148) From: Leif Hedstrom Subject: Re: Was a request cached Date: Thu, 30 Dec 2010 20:47:47 -0700 To: "users@trafficserver.apache.org" --Apple-Mail-6--220027436 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 In addition all the good suggestions, you can also send a request with a hea= der of Cache-Control: only-if-cached If the object is in cache, you get a 200 response, otherwise a 502. -- leif On Dec 30, 2010, at 7:24 PM, Eric Balsa wrote: > One can look at the Age header on the response too. >=20 > Eric >=20 > On Dec 30, 2010 6:13 PM, "ming.zym@gmail.com" wrote: > > TS will show much than you want, I think there is at least 3 solution: > > 1, you can enable Squid Style logging: > > CONFIG proxy.config.log.squid_log_enabled INT 1 > > then use "traffic_logcat squid.blog" and "grep" your logs, the output is= > > the standard Squid log style. > >=20 > > 2, you may enable VIA headers, which is disabled by default in later > > unstable release, but that is a great tool: > > CONFIG proxy.config.http.insert_response_via_str INT 1 > > all response will get a special VIA header, please following > > http://trafficserver.apache.org/docs/v2/admin/trouble.htm#interpret_via_= header > > to decode the header. > >=20 > > 3, you can even setup a cache looking http ui by: > > * traffic_line -s proxy.config.http_ui_enabled -v 3 > > * traffic_line -s proxy.config.http.enable_http_info -v 1 > > and setup some special remap target: > > map http://localhost/cache-internal/ http://{cache-internal} > > map http://localhost/cache/ http://{cache} > > map http://localhost/stat/ http://{stat} > > map http://localhost/test/ http://{test} > > map http://localhost/hostdb/ http://{hostdb} > > map http://localhost/net/ http://{net} > > map http://localhost/http/ http://{http} > > replace localhost with your situation. > > then you will get a cool tool to invest in cache status by web. this is > > the coolest way. > >=20 > > FYI > >=20 > >=20 > > =E5=9C=A8 2010-12-30=E5=9B=9B=E7=9A=84 12:32 -0800=EF=BC=8CJohn Cheng=E5= =86=99=E9=81=93=EF=BC=9A > >> This may be a silly question, but I could not find out how to > >> determine if a request was served from ATS' cache or not. > >>=20 > >> I want to make sure a particular Web Service URL is cached so our > >> development team can code against it without making actual requests to > >> the origin server (out of consideration for the origin system). > >>=20 > >> I have added the following in the cache.config file > >>=20 > >> url_regex=3Dwww.example.* action=3Dignore-server-no-cache > >> url_regex=3Dwww.example.* ttl-in-cache=3D24h > >> dest_domain=3Dwww.example.com action=3Dignore-server-no-cache > >> dest_domain=3Dwww.example.com ttl-in-cache=3D24h > >>=20 > >> I believe this should force ATS to cache all URLs from > >> www.example.com. However, I'm not sure how I can see if a particular > >> request was served from cache or not. Is there a logging option that > >> will show this? > >>=20 > >=20 > >=20 --Apple-Mail-6--220027436 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
In addition all the good suggestions, y= ou can also send a request with a header of

 &= nbsp;  Cache-Control: only-if-cached


If the object is in cache, you get a 200 response, otherwise a 502.
-- leif

On Dec 30, 2010, at 7:24 PM, Eric Bals= a <ericb@apache.org> wrote:

One can look at the A= ge header on the response too.

Eric

On Dec 30, 2010 6:13 PM, "ming.zym@gmail.com<= /a>" <ming.zym@gmail.com> wrote:
> T= S will show much than you want, I think there is at least 3 solution:
> 1, you can enable Squid Style logging:
> CONFIG proxy.config.log.= squid_log_enabled INT 1
> then use "traffic_logcat squid.blog" and "gr= ep" your logs, the output is
> the standard Squid log style.
>
> 2, you may enable VIA headers, which is disabled by default in= later
> unstable release, but that is a great tool:
> CONFIG pr= oxy.config.http.insert_response_via_str INT 1
> all response will get a= special VIA header, please following
> http://trafficserver.apache.org/docs/v2/a= dmin/trouble.htm#interpret_via_header
> to decode the header.<= br>>
> 3, you can even setup a cache looking http ui by:
> * traffic_line -s proxy.config.http_ui_enabled -v 3
> * t= raffic_line -s proxy.config.http.enable_http_info -v 1
> and setup s= ome special remap target:
> map http://localhost/cache-i= nternal/ http://{cache-internal}
> map http://localhost/cache/ http://{cache}
> map http://localhost/s= tat/ http://{stat}
> map http://localhost/test/ http://{test= }
> map http://localhost/hostdb/ http://{hostdb}
> map http://localhost/n= et/ http://{net}
> map http://localhost/http/ http://{http}<= br> > replace localhost with your situation.
> then you will get a co= ol tool to invest in cache status by web. this is
> the coolest way.>
> FYI
>
>
> =E5=9C=A8 2010-12-30=E5=9B=9B=E7= =9A=84 12:32 -0800=EF=BC=8CJohn Cheng=E5=86=99=E9=81=93=EF=BC=9A
>> This may be a silly question, but I could not find out how to
&g= t;> determine if a request was served from ATS' cache or not.
>>=
>> I want to make sure a particular Web Service URL is cached so o= ur
>> development team can code against it without making actual requests= to
>> the origin server (out of consideration for the origin syste= m).
>>
>> I have added the following in the cache.config f= ile
>>
>> url_regex=3Dwww.example.* action=3Dignore-server-no-ca= che
>> url_regex=3Dwww.example.* ttl-in-cache=3D24h
>> des= t_domain=3Dwww.example.com action=3Dignore-server-no-cache
>> dest_domain=3Dwww.example.com ttl-in-cache=3D24h
>>
= >> I believe this should force ATS to cache all URLs from
>> <= a href=3D"http://www.example.com">www.exa= mple.com. However, I'm not sure how I can see if a particular
>> request was served from cache or not. Is there a logging option tha= t
>> will show this?
>>
>
>
= --Apple-Mail-6--220027436--