Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible in squid to refresh parts of the cache on a set date of the month say?

I have data that gets regenerated once a month on a specific day, which I'd then like squid to cache for the next month, before marking it as stale.

A refresh pattern of refresh_pattern /path 0 100 60*24*30 won't work, because you can't guarantee that it will sync up with data refreshes.

share|improve this question
2  
There's a whole set of HTTP headers that allow you to specify exactly when a resource is to be considered stale. Why aren't you using those instead? –  womble Jul 5 '12 at 13:08

2 Answers 2

Here's what I think is a simple, practical approach to dealing with this:

You can (pre-)populate the squid cache by using wget --cache=off -r to spider the entire website(s) you want cached.

As far as scheduling it is concerned, can't you use the completion of the regeneration process to kickoff a prepopulation run?

share|improve this answer

Short answer is that you can't refresh an item in the cache using squid on it's own, but you can purge an item, then use wget or similar to populate the revised version. But the right way to solve the problem is, either as womble suggests, to set the right caching information on the origin server or to use different URLs for each version.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.