You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Rashid Zamani <ra...@gmail.com> on 2013/01/27 09:20:20 UTC

push content

I am trying to use push cache
option<http://trafficserver.apache.org/docs/trunk/admin/http-proxy-caching/index.en.html#PushingContentintoCache>of
Apache Traffic Server(ATS), to push some content into my cache. I read
the documentation, and tried to follow it but I have following
questions/problems using this option:

*1 -* In the documentation it mentiones in order to enable PUSH request,
modify proxy.config.http.quick_filter.mask in records.config. Yet I could
not find such a super mask to modify in that file. Running grep -r
proxy.config.http.quick_filter.mask . in ATS configuration folder shows me
that this super mask exists in ip_allow.config file. Are they the same?
Should I modify it there or should I add it to records.config?
Unfortunately I cannot check this due to my issue No.2.

*2 -* I am not sure how to send this HTTP PUSH request and to whom (on
which port - the same port ATS is running on?). There is
perl-script<https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=blob;f=tools/push.pl>which
suppose to automate the process, although I was not able to run the
script yet(don't know any perl but working on it - getting Can't locate
File/MimeInfo/Magic.pm in @INC). I wanted to print out the port from the
script to see how to push into the cache.

Any hints/tips would be appreciated.
-- 
Rashid Zamani

Re: push content

Posted by Rashid Zamani <ra...@gmail.com>.
I have done the changes in records.config and tried curl, this is what I
get, a 400 response:

# curl -v -X PUSH -H "Host:www.google.com" http://localhost/some_page

* About to connect() to localhost port 80 (#0)
*   Trying ::1... Connection
refused
*   Trying 127.0.0.1...
connected
> PUSH /some_page
HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-unknown-linux-gnu) libcurl/7.22.0
OpenSSL/1.0.0e zlib/1.2.5 c-ares/1.7.5 libidn/1.25 libssh2/1.2.9
> Accept: */*
> Host:www.google.com
>
< HTTP/1.1 400 request#no_content_length
< Date: Mon, 28 Jan 2013 11:42:23 GMT
< Connection: close
< Server: ATS/3.2.0
< Cache-Control: no-store
< Content-Type: text/html
< Content-Language: en
< Content-Length: 242
<
<HEAD><TITLE>request#no_content_length</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black">
<FONT FACE="Helvetica,Arial"><B>
 Unable to process requested URL.
</B></FONT>

<!-- default "request#no_content_length" response (400) -->
</BODY>
* Closing connection #0


On Sun, Jan 27, 2013 at 11:22 PM, Geert Lugtenberg <
geert.lugtenberg@poort80.nl> wrote:

>  There should be a configurable in records.config named *
> proxy.config.http.push_method_enabled* which you need to change from 0 to
> 1. Then I believe that the default in records.config is that the localhost
> can send requests to TS with alternative methods such as PURGE or PUSH. So
> if you don't need to PUSH content using another ip, on the same server
> running TS, try this:
>
> (pushing http://www.example.com/some_page in the cache)
>
> curl -v -X PUSH -H "Host:www.example.com" http://localhost/some_page
>
> 200 OK response if the page was succesfully pushed into cache.
>
>  ------------------------------
> *Van:* Rashid Zamani [rashid.z@gmail.com]
> *Verzonden:* zondag 27 januari 2013 9:20
> *Aan:* users@trafficserver.apache.org
> *Onderwerp:* push content
>
>    I am trying to use push cache option<http://trafficserver.apache.org/docs/trunk/admin/http-proxy-caching/index.en.html#PushingContentintoCache>of Apache Traffic Server(ATS), to push some content into my cache. I read
> the documentation, and tried to follow it but I have following
> questions/problems using this option:
>
> *1 -* In the documentation it mentiones in order to enable PUSH request,
> modify proxy.config.http.quick_filter.mask in records.config. Yet I could
> not find such a super mask to modify in that file. Running grep -r
> proxy.config.http.quick_filter.mask . in ATS configuration folder shows
> me that this super mask exists in ip_allow.config file. Are they the
> same? Should I modify it there or should I add it to records.config?
> Unfortunately I cannot check this due to my issue No.2.
>
> *2 -* I am not sure how to send this HTTP PUSH request and to whom (on
> which port - the same port ATS is running on?). There is perl-script<https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=blob;f=tools/push.pl>which suppose to automate the process, although I was not able to run the
> script yet(don't know any perl but working on it - getting Can't locate
> File/MimeInfo/Magic.pm in @INC). I wanted to print out the port from the
> script to see how to push into the cache.
>
> Any hints/tips would be appreciated.
>  --
> Rashid Zamani
>



-- 
Rashid Zamani

Re: push content

Posted by Otto van der Schaaf <os...@gmail.com>.
re: curl -v -X PUSH -H "Host:www.example.com" http://localhost/some_page

Does it work that way?
I remember having to send a complete http response including headers.
>From the v2 docs (http://trafficserver.apache.org/docs/v2/admin/http.htm):

Understanding HTTP PUSH

PUSH uses the HTTP 1.1 message format. The body of a PUSH request
contains the response header and response body that you want to place
in the cache. The following is an example of a PUSH request:

PUSH http://www.company.com HTTP/1.0
Content-length: 84
HTTP/1.0 200 OK
Content-type: text/html
Content-length: 17
<HTML>
a
</HTML>
IMPORTANT: Your header must include Content-length; Content-length
must include both header and body byte count.


2013/1/27 Geert Lugtenberg <ge...@poort80.nl>:
> There should be a configurable in records.config named
> proxy.config.http.push_method_enabled which you need to change from 0 to 1.
> Then I believe that the default in records.config is that the localhost can
> send requests to TS with alternative methods such as PURGE or PUSH. So if
> you don't need to PUSH content using another ip, on the same server running
> TS, try this:
>
> (pushing http://www.example.com/some_page in the cache)
>
> curl -v -X PUSH -H "Host:www.example.com" http://localhost/some_page
>
> 200 OK response if the page was succesfully pushed into cache.
>
> ________________________________
> Van: Rashid Zamani [rashid.z@gmail.com]
> Verzonden: zondag 27 januari 2013 9:20
> Aan: users@trafficserver.apache.org
> Onderwerp: push content
>
> I am trying to use push cache option of Apache Traffic Server(ATS), to push
> some content into my cache. I read the documentation, and tried to follow it
> but I have following questions/problems using this option:
>
> 1 - In the documentation it mentiones in order to enable PUSH request,
> modify proxy.config.http.quick_filter.mask in records.config. Yet I could
> not find such a super mask to modify in that file. Running grep -r
> proxy.config.http.quick_filter.mask . in ATS configuration folder shows me
> that this super mask exists in ip_allow.config file. Are they the same?
> Should I modify it there or should I add it to records.config? Unfortunately
> I cannot check this due to my issue No.2.
>
> 2 - I am not sure how to send this HTTP PUSH request and to whom (on which
> port - the same port ATS is running on?). There is perl-script which suppose
> to automate the process, although I was not able to run the script yet(don't
> know any perl but working on it - getting Can't locate
> File/MimeInfo/Magic.pm in @INC). I wanted to print out the port from the
> script to see how to push into the cache.
>
> Any hints/tips would be appreciated.
>
> --
> Rashid Zamani

RE: push content

Posted by Geert Lugtenberg <ge...@poort80.nl>.
There should be a configurable in records.config named proxy.config.http.push_method_enabled which you need to change from 0 to 1. Then I believe that the default in records.config is that the localhost can send requests to TS with alternative methods such as PURGE or PUSH. So if you don't need to PUSH content using another ip, on the same server running TS, try this:

(pushing http://www.example.com/some_page in the cache)

curl -v -X PUSH -H "Host:www.example.com" http://localhost/some_page

200 OK response if the page was succesfully pushed into cache.

________________________________
Van: Rashid Zamani [rashid.z@gmail.com]
Verzonden: zondag 27 januari 2013 9:20
Aan: users@trafficserver.apache.org
Onderwerp: push content


I am trying to use push cache option<http://trafficserver.apache.org/docs/trunk/admin/http-proxy-caching/index.en.html#PushingContentintoCache> of Apache Traffic Server(ATS), to push some content into my cache. I read the documentation, and tried to follow it but I have following questions/problems using this option:

1 - In the documentation it mentiones in order to enable PUSH request, modify proxy.config.http.quick_filter.mask in records.config. Yet I could not find such a super mask to modify in that file. Running grep -r proxy.config.http.quick_filter.mask . in ATS configuration folder shows me that this super mask exists in ip_allow.config file. Are they the same? Should I modify it there or should I add it to records.config? Unfortunately I cannot check this due to my issue No.2.

2 - I am not sure how to send this HTTP PUSH request and to whom (on which port - the same port ATS is running on?). There is perl-script<https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=blob;f=tools/push.pl> which suppose to automate the process, although I was not able to run the script yet(don't know any perl but working on it - getting Can't locate File/MimeInfo/Magic.pm in @INC). I wanted to print out the port from the script to see how to push into the cache.

Any hints/tips would be appreciated.

--
Rashid Zamani

Re: push content

Posted by James Peach <jp...@apache.org>.
On 27/01/2013, at 12:20 AM, Rashid Zamani <ra...@gmail.com> wrote:

> I am trying to use push cache option of Apache Traffic Server(ATS), to push some content into my cache. I read the documentation, and tried to follow it but I have following questions/problems using this option:
> 
> 1 - In the documentation it mentiones in order to enable PUSH request, modify proxy.config.http.quick_filter.mask in records.config. Yet I could not find such a super mask to modify in that file. Running grep -r proxy.config.http.quick_filter.mask . in ATS configuration folder shows me that this super mask exists in ip_allow.config file. Are they the same? Should I modify it there or should I add it to records.config? Unfortunately I cannot check this due to my issue No.2.


ip_allow.config replaces quick filter, see
	https://cwiki.apache.org/confluence/display/TS/Upgrading+to+3.2
	http://trafficserver.apache.org/docs/trunk/admin/configuration-files/ip_allow.config.en.html

> 
> 2 - I am not sure how to send this HTTP PUSH request and to whom (on which port - the same port ATS is running on?). There is perl-script which suppose to automate the process, although I was not able to run the script yet(don't know any perl but working on it - getting Can't locate File/MimeInfo/Magic.pm in @INC). I wanted to print out the port from the script to see how to push into the cache.
> 
> Any hints/tips would be appreciated.
> 
> -- 
> Rashid Zamani