You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Tom Melendez <to...@supertom.com> on 2013/06/16 01:20:48 UTC

cache miss checklist

Hey Folks,

Brought up a new ATS server, configured as a reverse proxy, and I'm seeing
that none of my requests are being cached.  Think you can help me walk
through what's up?  I suspect it's something trivial.

Here's what I have set:

# records.config
CONFIG proxy.config.http.uncacheable_requests_bypass_parent INT 1
CONFIG proxy.config.http.down_server.cache_time INT 600
   # cache control #
CONFIG proxy.config.http.cache.http INT 1
CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1
CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1
CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1
CONFIG proxy.config.http.cache.ignore_authentication INT 0
CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic INT 1
CONFIG proxy.config.http.cache.enable_default_vary_headers INT 0

# storage.config
var/trafficserver 1024M

# cache.config
(all commented out)

# remap.config
map http://my_domain http://an.ip.address.here

###
# typical header returned from server
###
HTTP/1.1 200 OK
Date: Sat, 15 Jun 2013 23:15:17 GMT
Server: ATS/3.2.4
X-Drupal-Cache: HIT
Etag: "1371338010-0"
X-Generator: Drupal 7 (http://drupal.org)
Cache-Control: public, max-age=0
Last-Modified: Sat, 15 Jun 2013 23:13:30 +0000
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary: Cookie,Accept-Encoding
Content-Type: text/html; charset=utf-8
Age: 0
Connection: keep-alive

# cache size
 sudo /usr/local/bin/traffic_line -r proxy.process.cache.bytes_total
1005346816

Making the requests with curl and Chrome.  It's not that I don't get all of
the pages/assets, it's just that NONE of them ever hit the cache.  Server
is on RHEL, on AWS (m1.large) running ATS 3.2.4 that I built with the
default options.

I have the extended, common, extended2 and squid logs enabled, so I should
be able to see most everything, right?

Thanks,

Tom

Re: cache miss checklist

Posted by Reindl Harald <h....@thelounge.net>.
Am 16.06.2013 01:20, schrieb Tom Melendez:
> Brought up a new ATS server, configured as a reverse proxy, and I'm seeing that none of my requests are being
> cached.  Think you can help me walk through what's up?  I suspect it's something trivial

> ###
> # typical header returned from server
> ###
> HTTP/1.1 200 OK

this is *uninteresting* and does not say anything about
if ATS has served the file from it's cache or requested
again from the origin - look in the accesslog of the
origin server to see "304" responses or in the best case
*nothing* while the client gets the document served
with a "200 OK"
_______________________________________________________

*which type* of content?

normally you do *not* want answers with session cookies cached
because if this happens whoever get the content of whoever
was logged in before and that is why mostly only static
content is and shoud be cached

additionally the caching headers of the orgin server are important
and if you orginin server sends "no cahce "headers any proxy has to
respect them

CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 3
_________________________________

proxy.config.http.cache.cache_responses_to_cookies
    INT
    Default: 3
    Reloadable.

    Specifies how cookies are cached:

        0 = do not cache any responses to cookies
        1 = cache for any content-type
        2 = cache only for image types
        3 = cache for all but text content-types
_________________________________

to get static htm/js/css cached for 30 or 60 seconds:

/etc/trafficserver/cache.config
# cache.config

url_regex=. suffix=css ttl-in-cache=30 cache-responses-to-cookies=1
url_regex=. suffix=js ttl-in-cache=30 cache-responses-to-cookies=1
url_regex=. suffix=txt ttl-in-cache=60 cache-responses-to-cookies=1
url_regex=. suffix=htm ttl-in-cache=60 cache-responses-to-cookies=1
url_regex=. suffix=html ttl-in-cache=60 cache-responses-to-cookies=1
url_regex=. suffix=xml ttl-in-cache=60 cache-responses-to-cookies=1
url_regex=. suffix=htc ttl-in-cache=60 cache-responses-to-cookies=1
_________________________________

httpd config snipped to control how long different content types are cached

<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType image/jpeg A60
 ExpiresByType image/jpg A60
 ExpiresByType image/gif A60
 ExpiresByType image/png A60
 ExpiresByType text/css A60
 ExpiresByType text/html A60
 ExpiresByType text/javascript A60
 ExpiresByType text/comma-separated-values A60
 ExpiresByType text/tab-separated-values A60
 ExpiresByType application/javascript A60
 ExpiresByType application/x-javascript A60
 ExpiresByType application/xhtml+xml A60
 ExpiresByType application/xml A60
</IfModule>


Re: cache miss checklist

Posted by Tom Melendez <to...@supertom.com>.
Thanks for the responses, Dudley and Reindl.

I made a couple of small tweaks and now see TCP_HITS when using multiple
clients.  I'll continue on with tuning and will be digging enabling/viewing
the statistics next.

Thanks for the help!

Tom

On Sat, Jun 15, 2013 at 4:53 PM, Dudley Carr <du...@gmail.com> wrote:

>  The expires header looks suspect in the sample response. I would try
> setting it to something sensible.
>
> On Saturday, June 15, 2013 at 4:20 PM, Tom Melendez wrote:
>
> Hey Folks,
>
> Brought up a new ATS server, configured as a reverse proxy, and I'm seeing
> that none of my requests are being cached.  Think you can help me walk
> through what's up?  I suspect it's something trivial.
>
> Here's what I have set:
>
> # records.config
> CONFIG proxy.config.http.uncacheable_requests_bypass_parent INT 1
> CONFIG proxy.config.http.down_server.cache_time INT 600
>    # cache control #
> CONFIG proxy.config.http.cache.http INT 1
> CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1
> CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1
> CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1
> CONFIG proxy.config.http.cache.ignore_authentication INT 0
> CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic INT 1
> CONFIG proxy.config.http.cache.enable_default_vary_headers INT 0
>
> # storage.config
> var/trafficserver 1024M
>
> # cache.config
> (all commented out)
>
> # remap.config
> map http://my_domain http://an.ip.address.here
>
> ###
> # typical header returned from server
> ###
> HTTP/1.1 200 OK
> Date: Sat, 15 Jun 2013 23:15:17 GMT
> Server: ATS/3.2.4
> X-Drupal-Cache: HIT
> Etag: "1371338010-0"
> X-Generator: Drupal 7 (http://drupal.org)
> Cache-Control: public, max-age=0
> Last-Modified: Sat, 15 Jun 2013 23:13:30 +0000
> Expires: Sun, 19 Nov 1978 05:00:00 GMT
> Vary: Cookie,Accept-Encoding
> Content-Type: text/html; charset=utf-8
> Age: 0
> Connection: keep-alive
>
> # cache size
>  sudo /usr/local/bin/traffic_line -r proxy.process.cache.bytes_total
> 1005346816
>
> Making the requests with curl and Chrome.  It's not that I don't get all
> of the pages/assets, it's just that NONE of them ever hit the cache.
>  Server is on RHEL, on AWS (m1.large) running ATS 3.2.4 that I built with
> the default options.
>
> I have the extended, common, extended2 and squid logs enabled, so I should
> be able to see most everything, right?
>
> Thanks,
>
> Tom
>
>
>

Re: cache miss checklist

Posted by Dudley Carr <du...@gmail.com>.
The expires header looks suspect in the sample response. I would try setting it to something sensible. 


On Saturday, June 15, 2013 at 4:20 PM, Tom Melendez wrote:

> Hey Folks,
> 
> Brought up a new ATS server, configured as a reverse proxy, and I'm seeing that none of my requests are being cached.  Think you can help me walk through what's up?  I suspect it's something trivial.   
> 
> Here's what I have set:
> 
> # records.config
> CONFIG proxy.config.http.uncacheable_requests_bypass_parent INT 1
> CONFIG proxy.config.http.down_server.cache_time INT 600
>    # cache control #
> CONFIG proxy.config.http.cache.http INT 1
> CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1
> CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1
> CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1
> CONFIG proxy.config.http.cache.ignore_authentication INT 0
> CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic INT 1
> CONFIG proxy.config.http.cache.enable_default_vary_headers INT 0
> 
> 
> # storage.config
> var/trafficserver 1024M
> 
> # cache.config
> (all commented out)
> 
> # remap.config
> map http://my_domain http://an.ip.address.here
> 
> ###
> # typical header returned from server
> ###
> HTTP/1.1 200 OK
> Date: Sat, 15 Jun 2013 23:15:17 GMT
> Server: ATS/3.2.4
> X-Drupal-Cache: HIT
> Etag: "1371338010-0"
> X-Generator: Drupal 7 (http://drupal.org)
> Cache-Control: public, max-age=0
> Last-Modified: Sat, 15 Jun 2013 23:13:30 +0000
> Expires: Sun, 19 Nov 1978 05:00:00 GMT
> Vary: Cookie,Accept-Encoding
> Content-Type: text/html; charset=utf-8
> Age: 0
> Connection: keep-alive
> 
> 
> # cache size
>  sudo /usr/local/bin/traffic_line -r proxy.process.cache.bytes_total
> 1005346816
> 
> 
> Making the requests with curl and Chrome.  It's not that I don't get all of the pages/assets, it's just that NONE of them ever hit the cache.  Server is on RHEL, on AWS (m1.large) running ATS 3.2.4 that I built with the default options. 
> 
> I have the extended, common, extended2 and squid logs enabled, so I should be able to see most everything, right?
> 
> Thanks,
> 
> Tom