Need To Cache Domain with Squid
Posted: Thu Mar 11, 2010 2:57 am
Aaaah!!! I give up!!!
After hours of working at this and not getting very far, I need to use Squid3 on Ubuntu (I'm on 8.04.4) such that requests to example.com from PHP (and Curl) get routed through a transparent Squid proxy in caching mode to cache requests for 1 day, but all other requests pass right on through.
I managed to get my iptables such that it routes into Squid3, but then it goes into pass-through mode and doesn't cache anything. I know this because I tried to cache volomike.com domain requests, and then tested with:
$ squid3client -t http://volomike.com/
If caching is setup properly, then you'll get one MISS on the first attempt, and then HIT responses on every time after that. But instead, all I received were MISS responses.
And why do I need to do this? Well, I'm mired down in another project, but a separate project that uses Curl requests against example.com is having trouble. The programmer that built that code was fired, and it's spaghetti code. Instead of me fixing the Curl in the PHP to do caching, I simply want a quick-fix solution with Squid3 where we route requests through it.
After hours of working at this and not getting very far, I need to use Squid3 on Ubuntu (I'm on 8.04.4) such that requests to example.com from PHP (and Curl) get routed through a transparent Squid proxy in caching mode to cache requests for 1 day, but all other requests pass right on through.
I managed to get my iptables such that it routes into Squid3, but then it goes into pass-through mode and doesn't cache anything. I know this because I tried to cache volomike.com domain requests, and then tested with:
$ squid3client -t http://volomike.com/
If caching is setup properly, then you'll get one MISS on the first attempt, and then HIT responses on every time after that. But instead, all I received were MISS responses.
And why do I need to do this? Well, I'm mired down in another project, but a separate project that uses Curl requests against example.com is having trouble. The programmer that built that code was fired, and it's spaghetti code. Instead of me fixing the Curl in the PHP to do caching, I simply want a quick-fix solution with Squid3 where we route requests through it.