Need To Cache Domain with Squid

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Need To Cache Domain with Squid

Post by volomike »

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.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Need To Cache Domain with Squid

Post by VladSun »

Can you describe your setup and network configuration/topology in more details?

Also post your squid config files and iptables rules.
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: Need To Cache Domain with Squid

Post by volomike »

Sorry, but I was told by the client (because of time issues) to park it on this and let the sysop try some options out for now, and got redirected to another "fire" for now (another project). But that fire will be out soon and I'll be back to see what the sysop has figured out. More than likely he will be just as stuck as I was and then I can get that info to you. So, for about a week, the Squid project is on hold.

I'll touch base again then.
Post Reply