Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a Squid (3.1) cache in front of Django. The content of the site does not change very often, so Squid gives our backend much needed breathing room.

Currently, this is the refresh pattern that we are using to cache the content:

refresh_pattern . 60 100% 60 We basically want to cache everything for at least an hour (and only an hour) before Squid then re-validates the content.

My question is on the "100%" parameter, which sets the lm-factor.

I'm not sure if setting that to 100% is doing what we want it to. The assumption was that by setting it to 100%, it would ensure that objects stay in the cache for the max cache time.

Is this an incorrect assumption?

What are the best practices that one should follow when setting up a refresh pattern like this?

share|improve this question

As the reference states :

Percent' is a percentage of the objects age (time since last modification age) an object without explicit expiry time will be considered fresh.


It means that for a 1-day-old object and a factor of 50%, the object will be consider fresh for 12h. And in addition, it would be consider fresh at least for the min time and at most for the max time.

The idea is to consider that an older object as less chance to become stale than a newer one.

With your refresh pattern, all objects are cached for 60 minutes exactly so the lm-factor does not really matter. I would recommend to keep it at 100%. I don't know what would happen with a factor of 0%, if anyone has a clue ?

The lm-factor would be more important if your max time was higher than your min time.

share|improve this answer

Your Answer


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.