Feature #2142

stat_cache increase

Added by crypt over 9 years ago. Updated over 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Missing in 1.5.x:


The simple stat_cache engine only caches for one second. On large static servers with sparse file changes, it could be a good idea to cache for a few more seconds - especially if you have really hard concurrency.

The attached patch uses a macro, which set the timeout to 1/4 minute. I think a config variable is not needed, but maybe a port to the build system.

stat_cache.patch (631 Bytes) stat_cache.patch crypt, 2009-12-31 15:12

Related issues

Related to Feature #2126: lighttpd patchesDuplicate2009-12-28




Updated by stbuehler over 9 years ago

  • Target version changed from 1.4.26 to 1.4.27

Updated by stbuehler over 9 years ago

  • Target version changed from 1.4.27 to 1.4.x

I don't think this is really important - stat calls should only be slow if the kernel has to load it from disk or network - i'll move it to 1.4.x (no time to review it right now).


Updated by gstrauss over 3 years ago

While patch is trivial, the question remains "should this be done here?" I think the answer is no. There are better alternatives.

server.stat-cache-engine = "simple" is intended to be exactly that: simple, and so I think the 1 second stat cache is reasonable. A better alternative, where available, is server.stat-cache-engine = "fam" which will reduce the stat() calls for filesystems that seldom change.

For highly loaded websites a caching proxy such as Varnish or Squid is recommended, as is offloading to a CDN for really high volume. Any of these will be much more efficient than just extending time to cache stat values.


Updated by stbuehler over 3 years ago

  • Status changed from New to Wontfix
  • Target version deleted (1.4.x)

Also given the stat-cache is cleared after 2 seconds anyway this patch is broken anyway.

Also available in: Atom