[FileBackend] Stat caching improvements.
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 16 Nov 2012 20:02:42 +0000 (12:02 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 16 Nov 2012 20:14:20 +0000 (12:14 -0800)
commitae63b9ae10cff9471cc32eb92dc29430bf3cd5cb
tree88e285ad95198d67602e958ea141c6d7bfb9c3ab
parentc13b693ac8ff536538bc44794e4c8c569468d976
[FileBackend] Stat caching improvements.

Callers often tend to end up calling getFileStat(), at least indirectly,
or in various successive function on the same path. This created RTTs
when the file didn't exist since negatives were not cached. This change
does the following:

* Cache definitive negatives (404s) in the process cache.
  Nothing is cached on failure (like network problems).
* Ignore process cache entries after a brief time period
  so long running scripts do not have overly stale entries.

Change-Id: I356bd9f48281e3c7e7a273778b2aca59c521a0c7
includes/cache/ProcessCacheLRU.php
includes/filebackend/FileBackendStore.php