Test ATS Injection Cache
Referenced by: Http://serverfault.com/questions/471684/push-content-to-apache-traffic-servers-cache
Get back:http/1.0 Response not cachable
The search learns that there is too little incoming information on the head and must contain items that reflect time. The answer should be for the old ATS version.
There is also a reference, more accurate http://zymlinux.net/trafficserver/FAQ.html
View Proxy-config-http-cache-required-headers's explanations in the official documentation. The default value is 2.
Modify content to
PUSH http://www.company.com http/1.0
content-length:84
http/1.0 OK
Content-type:text/html
expires:wed, 07:23:09 GMT
Cache-control:max-age=60
Content-length:17
<HTML>
A
</HTML>
Resubmit, get returned:http/1.0 Content Length
Originally added content, forgot to modify content-length, modified to 142, submitted again, succeeded
Final Overall display:
$ telnet 127.0.0.1 8080
Trying 127.0.0.1 ...
Connected to 127.0.0.1.
Escape character is ' ^] '.
PUSH http://www.company.com http/1.0
content-length:142
http/1.0 OK
Content-type:text/html
expires:wed, 07:23:09 GMT
Cache-control:max-age=60
Content-length:17
<HTML>
A
</HTML>http/1.0 201 Created
Date:fri, Sep 06:03:24 GMT
server:ats/5.3.1
content-length:0
Connection closed by foreign host.
[Email protected]:~$ </HTML>
Turn on http_ui, enter http://localhost:8080/cache/lookup_url?url=http://www.company.com in the browser
Can be seen already can be found.
Note Two questions:
1. The URL for request is http://www.company.com/and the last one is '/'.
2. Size is 11, not the above 17, the last "</HTML>" is not written, and the return information is immediately followed. It seems that there must be a blank line at the back of the copy.
ATS Push Cache Test