Re: [squid-users] Caching authenticated documents

2007-08-09 Thread Henrik Nordstrom
On mån, 2007-08-06 at 16:24 +0200, René GARCIA wrote:
 I
 had to force the webserver to send the Cache-Control header on each reply.

That's the correct thing to do. A HTTP/1.1 server must always respond
with an HTTP/1.1 response, minus the small things HTTP/1.1 says MUST NOT
be used in response to HTTP/1.0 requests. (mainly transfer-encoding)

Regards
Henrik


signature.asc
Description: This is a digitally signed message part


Re: [squid-users] Caching authenticated documents

2007-08-06 Thread Henrik Nordstrom
On ons, 2007-08-01 at 10:23 +0200, René GARCIA wrote:

 If I make the server respond Cache-control: public,proxy-revalidate in
 headers the document is not cached.

Do the document have any cache validator? (Last-Modified/ETag)

Without a cache validator there is nothing the cache can use to ask the
origin server if the document has been changed, and it won't be cached
unless it's considered fresh for some time (by default min 60 seconds).

Regards
Henrik


signature.asc
Description: This is a digitally signed message part


Re: [squid-users] Caching authenticated documents

2007-08-06 Thread René GARCIA
Le Lun 6 août 2007 15:33, Henrik Nordstrom a écrit :
 On ons, 2007-08-01 at 10:23 +0200, René GARCIA wrote:


 If I make the server respond Cache-control: public,proxy-revalidate
 in headers the document is not cached.

 Do the document have any cache validator? (Last-Modified/ETag)


 Without a cache validator there is nothing the cache can use to ask the
 origin server if the document has been changed, and it won't be cached
 unless it's considered fresh for some time (by default min 60 seconds).


Yes, the Etag/Last-Modified are sent but after a long search I finally
understand what was going wrong. My web server is a Sun One Web Server
6.1, it sends the Cache-Control header only on HTTP/1.1 requests. Squid
only sends HTTP/1.0 requests to the web server so the Cache-Control header
was never sent even if your browser sends HTTP/1.1 requests to squid. I
had to force the webserver to send the Cache-Control header on each reply.
Now it works fine. It makes an ugly config file for Sun One but finally I
managed squid to cache authenticated documents and to check user access
for each request.

Thank you for your reply.

Regards,
René



[squid-users] Caching authenticated documents

2007-08-01 Thread René GARCIA
Hi,

I'm working on making squid our new proxy service. The main goal of using
squid is to save bandwith between our distant sites.

I would like squid to cache authenticated documents (authorize basic auth)
but to continue verifying user auth to the final server.

If I had ignore-auth in squid config. The document is cached but no
longuer authenticated.
If I make the server respond Cache-control: public,proxy-revalidate in
headers the document is not cached.

I've been playing with Cache-control parameters with no success
(must-revalidate, s-maxage=0, ...).

What I would like is :
- For the first request on a document, the user sends authorizatrion
header. The server sends the document, squid keeps it in cache.
- For the following requests on that document, the new authorization
header is send by squid to the server with a If-Modified-Since header to
check cache validity. The server shoud respond 304 Not Modified if user
credetials are OK and document is up to date in cache.

Any idea how to configure squid for that ?

Rene