Search squid archive

Re: Unable to cache requests from Jetty server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16/10/10 21:52, Praveen Swadi wrote:
Hi,
Here are headers from a test PHP program, that gets cached in squid properly.
pswadi:Sites pswadi$ curl -v -o /tmp/def --proxy 192.168.1.102:3128 -u
ps:xxxx 'http://192.168.1.102/~pswadi/cachetest.php?a=b'
* About to connect() to proxy 192.168.1.102 port 3128 (#0)
*   Trying 192.168.1.102... connected
* Connected to 192.168.1.102 (192.168.1.102) port 3128 (#0)
* Server auth using Basic with user 'ps'
GET http://192.168.1.102/~pswadi/cachetest.php?a=b HTTP/1.1
Authorization: Basic cHM6cGFzc3dvcmQ=
User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
Host: 192.168.1.102
Accept: */*
Proxy-Connection: Keep-Alive

   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:-- --:--:--
--:--:--     0* HTTP 1.0, assume close after body
<  HTTP/1.0 200 OK
<  Date: Sat, 16 Oct 2010 07:16:27 GMT
<  Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l DAV/2 PHP/5.3.2
<  X-Powered-By: PHP/5.3.2
<  Cache-Control: max-age=120, public
<  Expires: Sat, 16 Oct 2010 07:18:29 GMT
<  Content-Length: 64
<  Content-Type: text/html
<  Age: 40
<  X-Cache: HIT from pswadi.local
<  Via: 1.1 pswadi.local:3128 (squid/2.7.STABLE9)
* HTTP/1.0 connection set to keep alive!
<  Connection: keep-alive
* HTTP/1.0 proxy connection set to keep alive!
<  Proxy-Connection: keep-alive
<
{ [data not shown]
   0    64    0    64    0     0  16439      0 --:--:-- --:--:--
--:--:-- 64000* Connection #0 to host 192.168.1.102 left intact
* Closing connection #0
 From squid log
1287213389.181   1426 192.168.1.102 TCP_REFRESH_MISS/200 477 GET
http://192.168.1.102/%7Epswadi/cachetest.php? - DIRECT/192.168.1.102
text/html
1287213427.433      0 192.168.1.102 TCP_MEM_HIT/200 485 GET
http://192.168.1.102/%7Epswadi/cachetest.php? - NONE/- text/html

For the requests coming from Jetty server, I get TCP_MISS.

pswadi:Sites pswadi$ curl -v --proxy 192.168.1.102:3128  -o /tmp/abc1
-u hadoop:xxxx 'http://10.10.10.10:8078/dashboard/server/tjx_hosted/2010-10-10T00/2010-10-12T00?reportType=server&customerId=tjx_hosted&startTime=2010-10-10T00&endTime=2010-10-12T00'
* About to connect() to proxy 192.168.1.102 port 3128 (#0)
*   Trying 192.168.1.102... connected
* Connected to 192.168.1.102 (192.168.1.102) port 3128 (#0)
* Server auth using Basic with user 'hadoop'
GET http://10.10.10.10:8078/dashboard/server/tjx_hosted/2010-10-10T00/2010-10-12T00?reportType=server&customerId=tjx_hosted&startTime=2010-10-10T00&endTime=2010-10-12T00 HTTP/1.1
Authorization: Basic aGFkb29wOjg5cjE4Zmpk
User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
Host: 10.10.10.10:8078
Accept: */*
Proxy-Connection: Keep-Alive

   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:--  0:00:04
--:--:--     0* HTTP 1.0, assume close after body
<  HTTP/1.0 200 OK
<  Cache-Control: max-age=120, public
<  Content-Type: text/plain
<  Expires: Sat, 16 Oct 2010 07:21:55 GMT
<  Server: Jetty(6.1.25)
<  X-Cache: MISS from pswadi.local
<  Via: 1.1 pswadi.local:3128 (squid/2.7.STABLE9)
<  Connection: close
<
{ [data not shown]
100 22142    0 22142    0     0   4342      0 --:--:--  0:00:05
--:--:--  5411* Closing connection #0

In the squid log

1287213595.589   5093 192.168.1.102 TCP_MISS/200 22386 GET
http://10.10.10.10:8078/dashboard/server/tjx_hosted/2010-10-10T00/2010-10-12T00?
- DIRECT/10.10.10.10 text/plain

What can be wrong?

Why do you think there is a problem? What are you expecting to happen.

The data is you have provided show three requests. On one request set a cached object is validated and the server returns a new copy to replace the stored version. A followup request uses the cached object.

With a separate request an object which is not cached gets fetched through Squid.

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.8
  Beta testers wanted for 3.2.0.2


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux