Search squid archive

RE: [squid-users] Clearing the Squid cache or disabling caching d uring certain periods

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: jennyw [mailto:jennyw@xxxxxxxxxxxxxxxxxx]
> Sent: Monday, February 07, 2005 1:32 PM
> To: squid-users@xxxxxxxxxxxxxxx
> Subject: [squid-users] Clearing the Squid cache or disabling caching
> during certain periods
> 
> 
> We're using Squid as a Web accelerator and need to clear the cache every 
> morning (the store goes into maintenance mode at 4 a.m. and all pages 
> have a message saying so; we don't want those pages cached).
> 
> Based on FAQ 7.3 (http://www.squid-cache.org/Doc/FAQ/FAQ-7.html#ss7.3), 
> I wrote this script to clear my Squid cache:
> 
> /usr/local/squid2/sbin/squid -k shutdown
> echo "" > /cache/swap.state
> /etc/init.d/squid start
> 
> This works but it sometimes has problems. Most of the times I've run it, 
> it works great.  However, sometimes when I run it, it says there are no 
> running instances of Squid, and then subsequently Squid doesn't start 
> up.  Any ideas on why this might be? I have been running the script a 
> few times in a row, which might be part of the problem ... could it just 
> be that I'm not giving it enough time before running it again, or could 
> something else be at work?
> 
> Also, does anyone have suggestions on causing a certain set of URLs to 
> not be cached during a certain time of night? My idea right now is to 
> have two squid.conf files -- one that includes the URLs affected by 
> maintenance mode and one that doesn't include them -- and setting up 
> cron jobs to switch between config files before and after the 
> maintenance period.
> 
> Thanks!
> 
> Jen
> 

First a disclaimer.  I've never tried something like this, so I have no idea
if it would work.

Anyway, by combining the "time" acl and the "no_cache" directive, you should
be able to specify times when URLs are not cached.

Something like:

acl maint_time time 04:00-05:00
acl maint_pages dstdomain .my.server
no_cache deny maint_time maint_pages

should prevent any pages served from the domain of my.server (and any
subdomains) from being cached between 4am and 5am, but will allow them to be
cached any other time of the day.  I think...  Again, I haven't tried this.

Chris

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux