Serving Content out of Cache

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Serving Content out of Cache

Chin, Kenneth (HBO)

Hello,

 

I have an Apache Traffic Server 4.0.2 hierarchical caching system.  I set the records.config file to ignore both client and server no-cache directives.  I want the child server to send content from its cache to a client web browser.  However, the child server always goes to the parent server and the parent server to the origin to send content.  As I understand the parameters:

 

CONFIG proxy.config.http.cache.ignore_client_no_cache INT 1

CONFIG proxy.config.http.cache.ims_on_client_no_cache INT 1

CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1

 

the child server is supposed to ignore the cache directive and serve the content directly from the child server’s cache and not from the origin server.  I am using raw disks for cache and see the content being stored in disk cache the first time a client requests the content.  The second client should get content from the child server’s cache but does not.

 

Thanks

 

Ken

---------------------------------------------------------------------
This e-mail is intended only for the use of the addressees. Any copying, forwarding, printing or other use of this e-mail by persons other than the addressees is not authorized. This e-mail may contain information that is privileged, confidential and exempt from disclosure. If you are not the intended recipient, please notify us immediately by return e-mail (including the original message in your reply) and then delete and discard all copies of the e-mail.

Thank you.

---------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: Serving Content out of Cache

Yongming Zhao
that sounds not as expected, but we need more detail to give you some advise, for example what your response header your origin server send. 

and we find that most of new coming to ATS will have trouble deal with the cache & no cache issue, and most of the config options in records.config already:
   #################
   # cache control #
   #################

for example, if your origin server send you responses with cookies:

   # cache responses to cookies has 5 options:
   #   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
   #   4 - cache for all but text content-types except OS response
   #       without "Set-Cookie" or with "Cache-Control: public"
   # See also cache-responses-to-cookies in cache.config.
CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1

and the basic rules for how to get the content cached:

   # required headers: three options:
   #   0 - No required headers to make document cachable
   #   1 - "Last-Modified:", "Expires:", or "Cache-Control: max-age" required
   #   2 - explicit lifetime required, "Expires:" or "Cache-Control: max-age"
CONFIG proxy.config.http.cache.required_headers INT 2


all those config directives and option values listed in “cache control" should be examined carefully, please refer to the online and in source documents.

thanks

在 2013年11月15日,上午4:51,Chin, Kenneth (HBO) <[hidden email]> 写道:

Hello,
 
I have an Apache Traffic Server 4.0.2 hierarchical caching system.  I set the records.config file to ignore both client and server no-cache directives.  I want the child server to send content from its cache to a client web browser.  However, the child server always goes to the parent server and the parent server to the origin to send content.  As I understand the parameters:
 
CONFIG proxy.config.http.cache.ignore_client_no_cache INT 1
CONFIG proxy.config.http.cache.ims_on_client_no_cache INT 1
CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1
 
the child server is supposed to ignore the cache directive and serve the content directly from the child server’s cache and not from the origin server.  I am using raw disks for cache and see the content being stored in disk cache the first time a client requests the content.  The second client should get content from the child server’s cache but does not.
 
Thanks
 
Ken

---------------------------------------------------------------------
This e-mail is intended only for the use of the addressees. Any copying, forwarding, printing or other use of this e-mail by persons other than the addressees is not authorized. This e-mail may contain information that is privileged, confidential and exempt from disclosure. If you are not the intended recipient, please notify us immediately by return e-mail (including the original message in your reply) and then delete and discard all copies of the e-mail. 

Thank you.

---------------------------------------------------------------------



signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Serving Content out of Cache

Chin, Kenneth (HBO)

Yongming,

 

Thanks for the response.  I have reviewed the Apache Traffic Server 4.0.2 documentation as well as all the configuration parameters carefully.  I was able to get Hierarchical Caching working successfully with some trial and error testing.  Note that these are just parameters that have been changed for a test system and will be adjusted accordingly for production.  Also, these are parameters that I used and may not work for your configuration.  I hope this helps anyone in the future.  Thanks to everyone.

 

Test Configuration

 

·         2 Origin Servers with Apache Web Server 2.2.15

·         2 Parent Servers with Apache Traffic Server 4.0.2

·         2 Edge Servers with Apache Traffic Server 4.0.2

 

Ken

 

Apache Traffic Server 4.0.2 Hierarchical Caching Parameters

 

cache.config

 

Parent

 

dest_domain=. action=ignore-no-cache

dest_domain=. ttl-in-cache=3d

dest_domain=. revalidate=1h

 

Child

 

dest_domain=. action=ignore-no-cache

dest_domain=. ttl-in-cache=3d

dest_domain=. revalidate=1h

 

 

parent.config

 

Parent

 

dest_domain=. parent=”origin.mydomain.com:80"

 

Child

 

dest_domain=. parent=origin.mydomain.com:80"

 

 

records.config

 

Parent

 

CONFIG proxy.config.http.server_ports STRING 80

CONFIG proxy.config.http.parent_proxy_routing_enable INT 1

CONFIG proxy.config.http.background_fill_active_timeout INT 0

CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.000000

CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1

CONFIG proxy.config.http.normalize_ae_gzip INT 1

CONFIG proxy.config.http.cache.required_headers INT 0

CONFIG proxy.config.cache.permit.pinning INT 1

CONFIG proxy.config.cache.ram_cache.size INT 32G

CONFIG proxy.config.cache.ram_cache.algorithm INT 1

CONFIG proxy.config.cache.enable_read_while_writer INT 1

CONFIG proxy.config.reverse_proxy.enabled INT 0

CONFIG proxy.config.url_remap.remap_required INT 0

 

Child

 

CONFIG proxy.config.http.server_ports STRING 80

CONFIG proxy.config.http.parent_proxy_routing_enable INT 1

CONFIG proxy.config.http.background_fill_active_timeout INT 0

CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.000000

CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1

CONFIG proxy.config.http.normalize_ae_gzip INT 1

CONFIG proxy.config.http.cache.required_headers INT 0

CONFIG proxy.config.cache.permit.pinning INT 1

CONFIG proxy.config.cache.ram_cache.size INT 32G

CONFIG proxy.config.cache.ram_cache.algorithm INT 1

CONFIG proxy.config.cache.enable_read_while_writer INT 1

CONFIG proxy.config.reverse_proxy.enabled INT 0

CONFIG proxy.config.url_remap.remap_required INT 0

 

storage.config

 

Parent

 

Remove file system cache:

 

  var/trafficserver 256M

 

Add raw device cache:

 

/dev/sdc

/dev/sdd

 

Child

 

Remove file system cache:

 

  var/trafficserver 256M

 

Add raw device cache:

 

/dev/sdc

/dev/sdd

 

 

From: Yongming Zhao [mailto:[hidden email]]
Sent: Saturday, November 16, 2013 11:21 AM
To: [hidden email]
Subject: Re: Serving Content out of Cache

 

that sounds not as expected, but we need more detail to give you some advise, for example what your response header your origin server send. 

 

and we find that most of new coming to ATS will have trouble deal with the cache & no cache issue, and most of the config options in records.config already:

   #################

   # cache control #

   #################

 

for example, if your origin server send you responses with cookies:

 

   # cache responses to cookies has 5 options:

   #   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

   #   4 - cache for all but text content-types except OS response

   #       without "Set-Cookie" or with "Cache-Control: public"

   # See also cache-responses-to-cookies in cache.config.

CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1

 

and the basic rules for how to get the content cached:

 

   # required headers: three options:

   #   0 - No required headers to make document cachable

   #   1 - "Last-Modified:", "Expires:", or "Cache-Control: max-age" required

   #   2 - explicit lifetime required, "Expires:" or "Cache-Control: max-age"

CONFIG proxy.config.http.cache.required_headers INT 2

 

 

all those config directives and option values listed in “cache control" should be examined carefully, please refer to the online and in source documents.

 

thanks

 

20131115日,上午4:51Chin, Kenneth (HBO) <[hidden email]> 写道:



Hello,

 

I have an Apache Traffic Server 4.0.2 hierarchical caching system.  I set the records.config file to ignore both client and server no-cache directives.  I want the child server to send content from its cache to a client web browser.  However, the child server always goes to the parent server and the parent server to the origin to send content.  As I understand the parameters:

 

CONFIG proxy.config.http.cache.ignore_client_no_cache INT 1

CONFIG proxy.config.http.cache.ims_on_client_no_cache INT 1

CONFIG proxy.config.http.cache.ignore_server_no_cache INT 1

 

the child server is supposed to ignore the cache directive and serve the content directly from the child server’s cache and not from the origin server.  I am using raw disks for cache and see the content being stored in disk cache the first time a client requests the content.  The second client should get content from the child server’s cache but does not.

 

Thanks

 

Ken

---------------------------------------------------------------------
This e-mail is intended only for the use of the addressees. Any copying, forwarding, printing or other use of this e-mail by persons other than the addressees is not authorized. This e-mail may contain information that is privileged, confidential and exempt from disclosure. If you are not the intended recipient, please notify us immediately by return e-mail (including the original message in your reply) and then delete and discard all copies of the e-mail. 

Thank you.

---------------------------------------------------------------------

 


mg_info.txt (630 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Serving Content out of Cache

Leif Hedstrom
On Nov 18, 2013, at 6:30 AM, "Chin, Kenneth (HBO)" <[hidden email]> wrote:


CONFIG proxy.config.http.cache.required_headers INT 0




Note that this setting allows anything that's not explicitly specified to be uncacheable to be cached by ATS. In most cases, a setting of 1 or 2 is much preferred. If your content can not be cached with one of those settings, you should probably examine your origins.

-- Leif