Koozali.org: home of the SME Server

Squid cache problem

Peter Fry

Squid cache problem
« on: March 03, 2003, 06:28:15 PM »
Hi
When I make changes to our web site I cannot view them from the machines connected to our e-smith email server which uses a squid cache.  

I can see the changes when I dialup directly so I know they've been made. I was told to clear the cache with the following commands:

service squid stop
echo "" > /var/spool/squid/swap.state
service squid start

and indeed this reduces swap.state to 0 bytes, however it hasn't cured the problem.

Is it impossible to force a fresh fetch when the e-smith server has the same domain name as the web site on a remote server?

Any suggestions welcome
Thanks
Peter

RayG

Re: Squid cache problem
« Reply #1 on: March 03, 2003, 09:53:17 PM »
I run into the same issue for the two remotely hosted web sites I maintain. For the time being I have been using Netscape to force a cache refresh and that works well enough. IE used to have an option to force a cache refresh but I cannot find any mention of it in current versions.

The proper solution is to add an 'always-direct' line to the squid.conf file. I havn't gotten around to trying this yet myself but it's described in the Squid faq:

http://www.squid-cache.org/Doc/FAQ/FAQ-4.html#ss4.19

Jim Goode

Re: Squid cache problem
« Reply #2 on: March 04, 2003, 12:48:33 AM »
I also had the same problem. I solved it temporarily by running the following script and then restarting squid.

#!/bin/bash
/usr/sbin/squid -k shutdown
echo "" > /var/spool/squid/swap.state
cd /var/spool/squid
mkdir JUNK
mv ?? swap.state* JUNK
rm -rf JUNK &

To restart squid.
#/usr/sbin/squid -z
#/etc/rc.d/rc7.d/S90squid start

This became a daily occurrance, so I disabled squid on the services panel.

Jim

Peter Fry

Re: Squid cache problem
« Reply #3 on: March 04, 2003, 06:50:33 PM »
Thanks for your suggestions, it's given me something to go on.

Abe Loveless

Re: Squid cache problem
« Reply #4 on: March 04, 2003, 11:03:20 PM »
If running SME 5.5 (haven't tested on 5.6 yet) you can use this:

http://tech-geeks.org/contrib/loveless/beta/squidProperties/

This will create a server-manager panel that will let you flush the cache, as well as enter specific domains that you want to force the server to allow always-direct connections.

Note:  The cache flush works on SME 5.x.  Less than 5.5 gives an error when using the always-direct options.

Hope this helps.

Kelvin

Re: Squid cache problem
« Reply #5 on: March 04, 2003, 11:49:03 PM »
Hi Abe,

I've been testing your Squid Properties contrib on my 5.6 server. So far so good, but I've not worked on it too extensively yet.

I too ran into a problem with a web page not updating. The problem was not the squid cache, it was actually IE6. Clearing the cache did not help so I had to delete my IE6 history and cleared all temporary internet files from IE6 before it worked again.

By the way, since you have started this project, could ask you to look into something else to do with squid ? I know the current version of squid supports web access control by MAC address (which was not available with the squid in SME 5.1.2 - missing some options). Could you incorporate that "feature" into your squid properties page. Basically, I want to have a means to give or deny access to the web by checking the MAC address of the workstation. If it is in the allowed list, fine, if not deny access. I currently do this by IP address by manually editing the squid.conf template and file but is getting cumbersome and also not something an end user admin can do (most of the end user admin I know should not get anywhere near a console prompt of their own Windows PC, let alone the SME server's !).

Thanks.

Kelvin

Abe Loveless

Re: Squid cache problem
« Reply #6 on: March 04, 2003, 11:56:28 PM »
Hmmm... interesting task.  :)

I'll give it a try and see what I come up with.  I've been wanting to do some things like that.  Shouldn't be too much trouble, just need to find a little spare time.

I'll post back to this thread when I have something worth testing.

Thanks,
Abe

Kelvin

Re: Squid cache problem
« Reply #7 on: March 05, 2003, 12:05:22 AM »
Thanks Abe,

In actual fact, I suppose the "proper" way to control internet access is to actually add to / modify the ipchains / iptables rules to alllow / disallow a particular MAC address from accessing the net. This should then also control other services like mail and FTP and not just web surfing.

I don't know if your experience covers the firewall rules or not, but I just thought I'd mention it.

Cheers,

Kelvin