HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Question on: How To Set Up A Caching Reverse Proxy With Squid 2.6 On Debian Etch (http://www.howtoforge.com/forums/showthread.php?t=30564)

tomdkat 23rd January 2009 19:49

Question on: How To Set Up A Caching Reverse Proxy With Squid 2.6 On Debian Etch
 
First, thanks for posting the great tutorial! :)

http://www.howtoforge.com/how-to-set...debian-etch-p2

We're trying this out now since we want to cache static pages generated by PHP. I don't know if this changes the classification of the page from "static" to "dynamic".

Anywho, we're interested in caching pages generated by PHP. We've got our PHP-based web app sending the correct Cache-control header to Squid (we're using Squid 3.0-STABLE12) and we're NOT sending any Expires or related headers. Using the Live HTTP Headers Firefox extension, I can see the response from Squid and it's generating a TCP_MISS each time I load the page:

Code:

HTTP/1.x 200 OK

Date: Fri, 23 Jan 2009 17:39:39 GMT

Server: Apache/2.2.3 (Red Hat)

X-Powered-By: PHP/5.2.8

Cache-Control: must-revalidate, max-age=0, s-maxage=10800

Vary: Accept-Encoding

Content-Encoding: gzip

Content-Length: 11237

Content-Type: text/html; charset=ISO-8859-1

X-Cache: MISS from www.mysite.com

Via: 1.0 www.mysite.com (squid/3.0.STABLE12)

Connection: keep-alive

Code:

HTTP/1.x 200 OK

Date: Fri, 23 Jan 2009 17:41:26 GMT

Server: Apache/2.2.3 (Red Hat)

X-Powered-By: PHP/5.2.8

Cache-Control: must-revalidate, max-age=0, s-maxage=10800

Vary: Accept-Encoding

Content-Encoding: gzip

Content-Length: 11233

Content-Type: text/html; charset=ISO-8859-1

X-Cache: MISS from www.mysite.com

Via: 1.0 www.mysite.com (squid/3.0.STABLE12)

Connection: keep-alive

Is it possible the tutorial doesn't apply to Squid 3? Any ideas?

Thanks!

Peace...

falko 24th January 2009 14:17

Quote:

Originally Posted by tomdkat (Post 165934)
Is it possible the tutorial doesn't apply to Squid 3?

Yes, that's possible. Unfortunately lots of things change between the Squid versions. :( Try 2.6.

tomdkat 25th January 2009 01:56

Ok, I got my problem figured out. :)

The problem was with my use of basic authentication being used to protect the site I'm currently testing with Squid acting as a HTTP accelerator. :)

Once I added a "public" Cache-Control header to the mix, everything started working just fine AND with Squid 3.0-STABLE12. :)

The only thing is with Squid 3, you will get these warning messages in the cache.log file:
Code:

2009/01/24 17:46:54| ACL::checklistMatches WARNING: 'cookie_logged_in_set' ACL is used but there is no HTTP reply -- not matching.
2009/01/24 17:46:54| ACL::checklistMatches WARNING: 'cookie_logged_in_out' ACL is used but there is no HTTP reply -- not matching.

This is due to the use of the rep_header ACL acltype being used. Apparently, at the time that ACL is processed, the request to the origin server hasn't been made yet so there won't be any HTTP reply to process:

http://www.squid-cache.org/mail-arch...0901/0501.html

In any event, things seem to be working just fine now!

Thanks!

Peace...


All times are GMT +2. The time now is 01:30.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.