You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Muhammad Faisal <fa...@yahoo.com> on 2016/01/29 11:02:15 UTC

Low cache hit ratio and object caching

Hello,
I'm testing ATS v6.0. I'm seeing the cache hit ratio is low im seeing 
too many TCP_MISS, TCP_IMS_MISS for the same websites which im trying to 
reopen. Also if a file is downloaded form the internet it should be 
available for the next request from the cache but im seeing direct 
connection in the logs:

This file download was the second attempt to check if the content is 
delivered from the Cache or not:


1454061387.378 123857 Client_IP TCP_MISS/206 6474156 GET 
http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
- DIRECT/netix.dl.sourceforge.net application/octet-stream
1454061458.314 70774 Client TCP_MISS/200 6477302 GET 
http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
- DIRECT/netix.dl.sourceforge.net application/octet-stream

Any advice to improve the situaiton?

Thanks
F.

Re: Low cache hit ratio and object caching

Posted by Reindl Harald <h....@thelounge.net>.

Am 04.02.2016 um 07:53 schrieb Miles Libbey:
> I think the problem may be that in this case is that there is nothing
> in the headers that tells ATS it is allowed to cache the object.  By
> default, this information is in the header Cache-control -- something
> like public, max-age=$seconds
>
> You could add this using the header_rewrite plugin

fix problems in headers from the origin there and not on the messenger
http://httpd.apache.org/docs/2.2/mod/mod_headers.html#header

> https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html
> I'm most familiar with it running as a remap plugin -- if you have a
> remap rule for this domain, you'd add a file that contained something
> like
> cond %{READ_RESPONSE_HDR_HOOK} [AND]
> cond %{HEADER:Cache-Control}
>      set-header Cache-Control "max-age=600, public" [L]


Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
Hi Miles,
Thanks for your response will give it a try.

F.

On 2/4/2016 11:53 AM, Miles Libbey wrote:
> I think the problem may be that in this case is that there is nothing
> in the headers that tells ATS it is allowed to cache the object.  By
> default, this information is in the header Cache-control -- something
> like public, max-age=$seconds
>
> You could add this using the header_rewrite plugin.
> https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html
> I'm most familiar with it running as a remap plugin -- if you have a
> remap rule for this domain, you'd add a file that contained something
> like
> cond %{READ_RESPONSE_HDR_HOOK} [AND]
> cond %{HEADER:Cache-Control}
>      set-header Cache-Control "max-age=600, public" [L]
>
> miles
>
> On Sat, Jan 30, 2016 at 6:19 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
>> Required Heads:
>> GET
>> /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe
>> HTTP/1.1
>> Host: netix.dl.sourceforge.net
>> Accept:
>> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>> Accept-Encoding: gzip, deflate, sdch
>> Accept-Language: en-US,en;q=0.8
>> Upgrade-Insecure-Requests: 1
>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
>> like Gecko) Chrome/47.0.2526.111 Safari/537.36
>>
>> HTTP/1.1 200 OK
>> Accept-Ranges: bytes
>> Content-Length: 6477032
>> Content-Type: application/octet-stream
>> Date: Sat, 30 Jan 2016 14:15:45 GMT
>> ETag: "62d4e8-5178afaba6ac0"
>> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
>> Server: Apache/2.4.6 (CentOS)
>>
>> I dont see any cache control header in the URL
>>
>>
>>
>> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>>
>>>
>>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>> sorry for being dumb but how to check the header from origin?
>>>>
>>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>> No -- from the origin. My real question is, are you sure that url is
>>>>> set to be cacheable?
>>>
>>> curl --head <url>
>>>


Re: Low cache hit ratio and object caching

Posted by Miles Libbey <ml...@gmail.com>.
I think the problem may be that in this case is that there is nothing
in the headers that tells ATS it is allowed to cache the object.  By
default, this information is in the header Cache-control -- something
like public, max-age=$seconds

You could add this using the header_rewrite plugin.
https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html
I'm most familiar with it running as a remap plugin -- if you have a
remap rule for this domain, you'd add a file that contained something
like
cond %{READ_RESPONSE_HDR_HOOK} [AND]
cond %{HEADER:Cache-Control}
    set-header Cache-Control "max-age=600, public" [L]

miles

On Sat, Jan 30, 2016 at 6:19 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
> Required Heads:
> GET
> /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe
> HTTP/1.1
> Host: netix.dl.sourceforge.net
> Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
> Accept-Encoding: gzip, deflate, sdch
> Accept-Language: en-US,en;q=0.8
> Upgrade-Insecure-Requests: 1
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
> like Gecko) Chrome/47.0.2526.111 Safari/537.36
>
> HTTP/1.1 200 OK
> Accept-Ranges: bytes
> Content-Length: 6477032
> Content-Type: application/octet-stream
> Date: Sat, 30 Jan 2016 14:15:45 GMT
> ETag: "62d4e8-5178afaba6ac0"
> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
> Server: Apache/2.4.6 (CentOS)
>
> I dont see any cache control header in the URL
>
>
>
> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>
>>
>>
>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>
>>> sorry for being dumb but how to check the header from origin?
>>>
>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>
>>>> No -- from the origin. My real question is, are you sure that url is
>>>> set to be cacheable?
>>
>>
>> curl --head <url>
>>
>

Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
Thanks Reindl for highlighting the risk. I have modified it to eliminate 
the risk factor.

On 2/5/2016 12:20 AM, Reindl Harald wrote:
>
>
> Am 04.02.2016 um 20:15 schrieb Muhammad Faisal:
>> *Hi James,*
>> I'm sorry I couldn't get. I have set
>> "proxy.config.http.cache.required_header" to 0 so that everything get
>> cached regardless of the header condition since the origin server
>> response is not under our control. This is what i understood from the
>> parameter description and set it accordingly.
>>
>>   * |0|= no headers required to make document cacheable
>>   * |1|= either the|Last-Modified|header, or an explicit lifetime
>>     header,|Expires|or|Cache-Control:max-age|, is required
>>   * |2|= explicit lifetime is 
>> required,|Expires|or|Cache-Control:max-age|
>
> that's probably a dangerous game when it comes to session-cookies 
> (typically headers) and you ignore "Cache-Control: private" which 
> should be set by any sane application when it's aware that there is a 
> user login active
>
> the most possible harm which can happen on a proxy is cache private 
> and sensible data while deliver it to the wrong user / client
>
> you need to get the origin server somehow under your control and if 
> that means "talk to the admin on the other side" so be it
>
>> On 2/5/2016 12:01 AM, James Peach wrote:
>>>> On Feb 4, 2016, at 10:36 AM, Muhammad Faisal<fa...@yahoo.com>  
>>>> wrote:
>>>>
>>>> Hi James,
>>>> In the configuraitons the proxy.config.http.cache.required_headers 
>>>> is set to 0.  No header configuration required, it means cache 
>>>> everything regardless of the headers. Am I right? Should i change 
>>>> it to 1?
>>> Emitting a Cache-Control header is the best approach. Failing that 
>>> setting required_headers is an option. I have found the xdebug 
>>> plugin helpful for debugging this sort of problem.
>>>
>>>>
>>>> On 2/4/2016 9:19 PM, James Peach wrote:
>>>>>> On Jan 30, 2016, at 6:19 AM, Muhammad 
>>>>>> Faisal<fa...@yahoo.com>  wrote:
>>>>>>
>>>>>> Required Heads:
>>>>>> GET 
>>>>>> /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>>>>>> HTTP/1.1
>>>>>> Host: netix.dl.sourceforge.net
>>>>>> Accept: 
>>>>>> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>>>>>> Accept-Encoding: gzip, deflate, sdch
>>>>>> Accept-Language: en-US,en;q=0.8
>>>>>> Upgrade-Insecure-Requests: 1
>>>>>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) 
>>>>>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 
>>>>>> Safari/537.36
>>>>>>
>>>>>> HTTP/1.1 200 OK
>>>>>> Accept-Ranges: bytes
>>>>>> Content-Length: 6477032
>>>>>> Content-Type: application/octet-stream
>>>>>> Date: Sat, 30 Jan 2016 14:15:45 GMT
>>>>>> ETag: "62d4e8-5178afaba6ac0"
>>>>>> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
>>>>>> Server: Apache/2.4.6 (CentOS)
>>>>> You have a Last-Modified but no Cache-Control, so set 
>>>>> proxy.config.http.cache.required_headers=1.
>>>>>
>>>>> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-cache-required-headers 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> I dont see any cache control header in the URL
>>>>>>
>>>>>>
>>>>>> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>>>>>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>>>>>> sorry for being dumb but how to check the header from origin?
>>>>>>>>
>>>>>>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>>>>>> No -- from the origin. My real question is, are you sure that 
>>>>>>>>> url is
>>>>>>>>> set to be cacheable?
>>>>>>> curl --head <url>
>


Re: Low cache hit ratio and object caching

Posted by Leif Hedstrom <zw...@apache.org>.
> On Feb 4, 2016, at 12:20 PM, Reindl Harald <h....@thelounge.net> wrote:
> 
> 
> 
> Am 04.02.2016 um 20:15 schrieb Muhammad Faisal:
>> *Hi James,*
>> I'm sorry I couldn't get. I have set
>> "proxy.config.http.cache.required_header" to 0 so that everything get
>> cached regardless of the header condition since the origin server
>> response is not under our control. This is what i understood from the
>> parameter description and set it accordingly.
>> 
>>  * |0|= no headers required to make document cacheable
>>  * |1|= either the|Last-Modified|header, or an explicit lifetime
>>    header,|Expires|or|Cache-Control:max-age|, is required
>>  * |2|= explicit lifetime is required,|Expires|or|Cache-Control:max-age|
> 
> that's probably a dangerous game when it comes to session-cookies (typically headers) and you ignore "Cache-Control: private" which should be set by any sane application when it's aware that there is a user login active
> 
> the most possible harm which can happen on a proxy is cache private and sensible data while deliver it to the wrong user / client
> 
> you need to get the origin server somehow under your control and if that means "talk to the admin on the other side" so be it


+1. Beat the origins into submission! :-)


If that still doesn’t work, what I typically do is using header_rewrite to make the responses from those misbehaving origin(s) be reasonable, but this can also be difficult. But in almost all cases, do I leave the proxy.config.http.cache.required_header left at “2”.

Cheers,

— leif


Re: Low cache hit ratio and object caching

Posted by Reindl Harald <h....@thelounge.net>.

Am 04.02.2016 um 20:15 schrieb Muhammad Faisal:
> *Hi James,*
> I'm sorry I couldn't get. I have set
> "proxy.config.http.cache.required_header" to 0 so that everything get
> cached regardless of the header condition since the origin server
> response is not under our control. This is what i understood from the
> parameter description and set it accordingly.
>
>   * |0|= no headers required to make document cacheable
>   * |1|= either the|Last-Modified|header, or an explicit lifetime
>     header,|Expires|or|Cache-Control:max-age|, is required
>   * |2|= explicit lifetime is required,|Expires|or|Cache-Control:max-age|

that's probably a dangerous game when it comes to session-cookies 
(typically headers) and you ignore "Cache-Control: private" which should 
be set by any sane application when it's aware that there is a user 
login active

the most possible harm which can happen on a proxy is cache private and 
sensible data while deliver it to the wrong user / client

you need to get the origin server somehow under your control and if that 
means "talk to the admin on the other side" so be it

> On 2/5/2016 12:01 AM, James Peach wrote:
>>> On Feb 4, 2016, at 10:36 AM, Muhammad Faisal<fa...@yahoo.com>  wrote:
>>>
>>> Hi James,
>>> In the configuraitons the proxy.config.http.cache.required_headers is set to 0.  No header configuration required, it means cache everything regardless of the headers. Am I right? Should i change it to 1?
>> Emitting a Cache-Control header is the best approach. Failing that setting required_headers is an option. I have found the xdebug plugin helpful for debugging this sort of problem.
>>
>>>
>>> On 2/4/2016 9:19 PM, James Peach wrote:
>>>>> On Jan 30, 2016, at 6:19 AM, Muhammad Faisal<fa...@yahoo.com>  wrote:
>>>>>
>>>>> Required Heads:
>>>>> GET /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe HTTP/1.1
>>>>> Host: netix.dl.sourceforge.net
>>>>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>>>>> Accept-Encoding: gzip, deflate, sdch
>>>>> Accept-Language: en-US,en;q=0.8
>>>>> Upgrade-Insecure-Requests: 1
>>>>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
>>>>>
>>>>> HTTP/1.1 200 OK
>>>>> Accept-Ranges: bytes
>>>>> Content-Length: 6477032
>>>>> Content-Type: application/octet-stream
>>>>> Date: Sat, 30 Jan 2016 14:15:45 GMT
>>>>> ETag: "62d4e8-5178afaba6ac0"
>>>>> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
>>>>> Server: Apache/2.4.6 (CentOS)
>>>> You have a Last-Modified but no Cache-Control, so set proxy.config.http.cache.required_headers=1.
>>>>
>>>> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-cache-required-headers
>>>>
>>>>
>>>>
>>>>> I dont see any cache control header in the URL
>>>>>
>>>>>
>>>>> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>>>>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>>>>> sorry for being dumb but how to check the header from origin?
>>>>>>>
>>>>>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>>>>> No -- from the origin. My real question is, are you sure that url is
>>>>>>>> set to be cacheable?
>>>>>> curl --head <url>


Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
*Hi James,*
I'm sorry I couldn't get. I have set 
"proxy.config.http.cache.required_header" to 0 so that everything get 
cached regardless of the header condition since the origin server 
response is not under our control. This is what i understood from the 
parameter description and set it accordingly.

"

  * |0|= no headers required to make document cacheable
  * |1|= either the|Last-Modified|header, or an explicit lifetime
    header,|Expires|or|Cache-Control:max-age|, is required
  * |2|= explicit lifetime is required,|Expires|or|Cache-Control:max-age|

"

Thanks
F.


On 2/5/2016 12:01 AM, James Peach wrote:
>> On Feb 4, 2016, at 10:36 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
>>
>> Hi James,
>> In the configuraitons the proxy.config.http.cache.required_headers is set to 0.  No header configuration required, it means cache everything regardless of the headers. Am I right? Should i change it to 1?
> Emitting a Cache-Control header is the best approach. Failing that setting required_headers is an option. I have found the xdebug plugin helpful for debugging this sort of problem.
>
>> Thanks
>> F.
>>
>>
>> On 2/4/2016 9:19 PM, James Peach wrote:
>>>> On Jan 30, 2016, at 6:19 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
>>>>
>>>> Required Heads:
>>>> GET /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe HTTP/1.1
>>>> Host: netix.dl.sourceforge.net
>>>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>>>> Accept-Encoding: gzip, deflate, sdch
>>>> Accept-Language: en-US,en;q=0.8
>>>> Upgrade-Insecure-Requests: 1
>>>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
>>>>
>>>> HTTP/1.1 200 OK
>>>> Accept-Ranges: bytes
>>>> Content-Length: 6477032
>>>> Content-Type: application/octet-stream
>>>> Date: Sat, 30 Jan 2016 14:15:45 GMT
>>>> ETag: "62d4e8-5178afaba6ac0"
>>>> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
>>>> Server: Apache/2.4.6 (CentOS)
>>> You have a Last-Modified but no Cache-Control, so set proxy.config.http.cache.required_headers=1.
>>>
>>> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-cache-required-headers
>>>
>>>
>>>
>>>> I dont see any cache control header in the URL
>>>>
>>>>
>>>> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>>>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>>>> sorry for being dumb but how to check the header from origin?
>>>>>>
>>>>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>>>> No -- from the origin. My real question is, are you sure that url is
>>>>>>> set to be cacheable?
>>>>> curl --head <url>
>>>>>


Re: Low cache hit ratio and object caching

Posted by James Peach <jp...@apache.org>.
> On Feb 4, 2016, at 10:36 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
> 
> Hi James,
> In the configuraitons the proxy.config.http.cache.required_headers is set to 0.  No header configuration required, it means cache everything regardless of the headers. Am I right? Should i change it to 1?

Emitting a Cache-Control header is the best approach. Failing that setting required_headers is an option. I have found the xdebug plugin helpful for debugging this sort of problem.

> 
> Thanks
> F.
> 
> 
> On 2/4/2016 9:19 PM, James Peach wrote:
>>> On Jan 30, 2016, at 6:19 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
>>> 
>>> Required Heads:
>>> GET /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe HTTP/1.1
>>> Host: netix.dl.sourceforge.net
>>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>>> Accept-Encoding: gzip, deflate, sdch
>>> Accept-Language: en-US,en;q=0.8
>>> Upgrade-Insecure-Requests: 1
>>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
>>> 
>>> HTTP/1.1 200 OK
>>> Accept-Ranges: bytes
>>> Content-Length: 6477032
>>> Content-Type: application/octet-stream
>>> Date: Sat, 30 Jan 2016 14:15:45 GMT
>>> ETag: "62d4e8-5178afaba6ac0"
>>> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
>>> Server: Apache/2.4.6 (CentOS)
>> You have a Last-Modified but no Cache-Control, so set proxy.config.http.cache.required_headers=1.
>> 
>> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-cache-required-headers
>> 
>> 
>> 
>>> I dont see any cache control header in the URL
>>> 
>>> 
>>> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>>> 
>>>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>>> sorry for being dumb but how to check the header from origin?
>>>>> 
>>>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>>> No -- from the origin. My real question is, are you sure that url is
>>>>>> set to be cacheable?
>>>> curl --head <url>
>>>> 
> 


Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
Hi James,
In the configuraitons the proxy.config.http.cache.required_headers is 
set to 0.  No header configuration required, it means cache everything 
regardless of the headers. Am I right? Should i change it to 1?

Thanks
F.


On 2/4/2016 9:19 PM, James Peach wrote:
>> On Jan 30, 2016, at 6:19 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
>>
>> Required Heads:
>> GET /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe HTTP/1.1
>> Host: netix.dl.sourceforge.net
>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>> Accept-Encoding: gzip, deflate, sdch
>> Accept-Language: en-US,en;q=0.8
>> Upgrade-Insecure-Requests: 1
>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
>>
>> HTTP/1.1 200 OK
>> Accept-Ranges: bytes
>> Content-Length: 6477032
>> Content-Type: application/octet-stream
>> Date: Sat, 30 Jan 2016 14:15:45 GMT
>> ETag: "62d4e8-5178afaba6ac0"
>> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
>> Server: Apache/2.4.6 (CentOS)
> You have a Last-Modified but no Cache-Control, so set proxy.config.http.cache.required_headers=1.
>
> https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-cache-required-headers
>
>
>
>> I dont see any cache control header in the URL
>>
>>
>> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>>>
>>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>>> sorry for being dumb but how to check the header from origin?
>>>>
>>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>>> No -- from the origin. My real question is, are you sure that url is
>>>>> set to be cacheable?
>>> curl --head <url>
>>>


Re: Low cache hit ratio and object caching

Posted by James Peach <jp...@apache.org>.
> On Jan 30, 2016, at 6:19 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
> 
> Required Heads:
> GET /project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe HTTP/1.1
> Host: netix.dl.sourceforge.net
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
> Accept-Encoding: gzip, deflate, sdch
> Accept-Language: en-US,en;q=0.8
> Upgrade-Insecure-Requests: 1
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
> 
> HTTP/1.1 200 OK
> Accept-Ranges: bytes
> Content-Length: 6477032
> Content-Type: application/octet-stream
> Date: Sat, 30 Jan 2016 14:15:45 GMT
> ETag: "62d4e8-5178afaba6ac0"
> Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
> Server: Apache/2.4.6 (CentOS)

You have a Last-Modified but no Cache-Control, so set proxy.config.http.cache.required_headers=1.

https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html#proxy-config-http-cache-required-headers



> 
> I dont see any cache control header in the URL
> 
> 
> On 1/30/2016 6:40 AM, Reindl Harald wrote:
>> 
>> 
>> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>>> sorry for being dumb but how to check the header from origin?
>>> 
>>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>>> No -- from the origin. My real question is, are you sure that url is
>>>> set to be cacheable?
>> 
>> curl --head <url>
>> 
> 


Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
Required Heads:
GET 
/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
HTTP/1.1
Host: netix.dl.sourceforge.net
Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36

HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 6477032
Content-Type: application/octet-stream
Date: Sat, 30 Jan 2016 14:15:45 GMT
ETag: "62d4e8-5178afaba6ac0"
Last-Modified: Tue, 02 Jun 2015 15:56:03 GMT
Server: Apache/2.4.6 (CentOS)

I dont see any cache control header in the URL


On 1/30/2016 6:40 AM, Reindl Harald wrote:
>
>
> Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
>> sorry for being dumb but how to check the header from origin?
>>
>> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>>> No -- from the origin. My real question is, are you sure that url is
>>> set to be cacheable?
>
> curl --head <url>
>


Re: Low cache hit ratio and object caching

Posted by Reindl Harald <h....@thelounge.net>.

Am 29.01.2016 um 20:46 schrieb Muhammad Faisal:
> sorry for being dumb but how to check the header from origin?
>
> On 1/30/2016 12:41 AM, Miles Libbey wrote:
>> No -- from the origin. My real question is, are you sure that url is
>> set to be cacheable?

curl --head <url>


Re: Low cache hit ratio and object caching

Posted by Leif Hedstrom <zw...@apache.org>.
> On Jan 29, 2016, at 12:46 PM, Muhammad Faisal <fa...@yahoo.com> wrote:
> 
> sorry for being dumb but how to check the header from origin?

tcpdump would work. But even easier is to run ATS with the diagnostics headers enabled for http_hdrs, e.g.


	$ sudo trafficserver stop
	$ sudo traffic_server -T http_hdrs


And then run a request, it’ll show all headers.

— Leif



Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
sorry for being dumb but how to check the header from origin?

On 1/30/2016 12:41 AM, Miles Libbey wrote:
> No -- from the origin. My real question is, are you sure that url is 
> set to be cacheable?
>
>
> On Friday, January 29, 2016 9:53 AM, Muhammad Faisal 
> <fa...@yahoo.com> wrote:
>
>
> Header from client side? I have ignore client side no_cache while 
> server side no_cache will be effective.
>
> On 1/29/2016 10:22 PM, Miles Libbey wrote:
> Can you send the headers that
> http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>
> returns? (Wondering what the Cache-control: header says about the 
> caching policy for that object).
>
> miles
>
>
> On Friday, January 29, 2016 2:02 AM, Muhammad Faisal 
> <fa...@yahoo.com> <ma...@yahoo.com> wrote:
>
>
> Hello,
> I'm testing ATS v6.0. I'm seeing the cache hit ratio is low im seeing
> too many TCP_MISS, TCP_IMS_MISS for the same websites which im trying to
> reopen. Also if a file is downloaded form the internet it should be
> available for the next request from the cache but im seeing direct
> connection in the logs:
>
> This file download was the second attempt to check if the content is
> delivered from the Cache or not:
>
>
> 1454061387.378 123857 Client_IP TCP_MISS/206 6474156 GET
> http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>
> - DIRECT/netix.dl.sourceforge.net application/octet-stream
> 1454061458.314 70774 Client TCP_MISS/200 6477302 GET
> http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>
> - DIRECT/netix.dl.sourceforge.net application/octet-stream
>
> Any advice to improve the situaiton?
>
> Thanks
> F.
>
>
>
>
>


Re: Low cache hit ratio and object caching

Posted by Miles Libbey <ml...@apache.org>.
No -- from the origin. My real question is, are you sure that url is set to be cacheable? 

    On Friday, January 29, 2016 9:53 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
 

  Header from client side? I have ignore client side no_cache while server side no_cache will be effective.
 
 On 1/29/2016 10:22 PM, Miles Libbey wrote:
  
 
 Can you send the headers that  http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
  returns? (Wondering what the Cache-control: header says about the caching policy for that object). 
  miles 
 
      On Friday, January 29, 2016 2:02 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
  
 
 Hello,
 I'm testing ATS v6.0. I'm seeing the cache hit ratio is low im seeing 
 too many TCP_MISS, TCP_IMS_MISS for the same websites which im trying to 
 reopen. Also if a file is downloaded form the internet it should be 
 available for the next request from the cache but im seeing direct 
 connection in the logs:
 
 This file download was the second attempt to check if the content is 
 delivered from the Cache or not:
 
 
 1454061387.378 123857 Client_IP TCP_MISS/206 6474156 GET 
 http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
 - DIRECT/netix.dl.sourceforge.net application/octet-stream
 1454061458.314 70774 Client TCP_MISS/200 6477302 GET 
 http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
 - DIRECT/netix.dl.sourceforge.net application/octet-stream
 
 Any advice to improve the situaiton?
 
 Thanks
 F.
 
 
      
 

  

Re: Low cache hit ratio and object caching

Posted by Muhammad Faisal <fa...@yahoo.com>.
Header from client side? I have ignore client side no_cache while server 
side no_cache will be effective.

On 1/29/2016 10:22 PM, Miles Libbey wrote:
> Can you send the headers that
> http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>
> returns? (Wondering what the Cache-control: header says about the 
> caching policy for that object).
>
> miles
>
>
> On Friday, January 29, 2016 2:02 AM, Muhammad Faisal 
> <fa...@yahoo.com> wrote:
>
>
> Hello,
> I'm testing ATS v6.0. I'm seeing the cache hit ratio is low im seeing
> too many TCP_MISS, TCP_IMS_MISS for the same websites which im trying to
> reopen. Also if a file is downloaded form the internet it should be
> available for the next request from the cache but im seeing direct
> connection in the logs:
>
> This file download was the second attempt to check if the content is
> delivered from the Cache or not:
>
>
> 1454061387.378 123857 Client_IP TCP_MISS/206 6474156 GET
> http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>
> - DIRECT/netix.dl.sourceforge.net application/octet-stream
> 1454061458.314 70774 Client TCP_MISS/200 6477302 GET
> http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
>
> - DIRECT/netix.dl.sourceforge.net application/octet-stream
>
> Any advice to improve the situaiton?
>
> Thanks
> F.
>
>


Re: Low cache hit ratio and object caching

Posted by Miles Libbey <ml...@apache.org>.
Can you send the headers that http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
returns? (Wondering what the Cache-control: header says about the caching policy for that object).
miles 

    On Friday, January 29, 2016 2:02 AM, Muhammad Faisal <fa...@yahoo.com> wrote:
 

 Hello,
I'm testing ATS v6.0. I'm seeing the cache hit ratio is low im seeing 
too many TCP_MISS, TCP_IMS_MISS for the same websites which im trying to 
reopen. Also if a file is downloaded form the internet it should be 
available for the next request from the cache but im seeing direct 
connection in the logs:

This file download was the second attempt to check if the content is 
delivered from the Cache or not:


1454061387.378 123857 Client_IP TCP_MISS/206 6474156 GET 
http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
- DIRECT/netix.dl.sourceforge.net application/octet-stream
1454061458.314 70774 Client TCP_MISS/200 6477302 GET 
http://netix.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.11.0.2/FileZilla_3.11.0.2_win64-setup.exe 
- DIRECT/netix.dl.sourceforge.net application/octet-stream

Any advice to improve the situaiton?

Thanks
F.