Re: realpath() caching

From: Date: Wed, 22 Sep 2004 09:52:41 +0000
Subject: Re: realpath() caching
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-12932@lists.php.net to get a copy of this message
Sara Golemon wrote:
realpath_cache_ttl - Time to live for cache entry (default 120 seconds; if set to 0 then doesn't refresh).
Ah, didn't grok the TTL at first glance.... that fairly well negates the need for an explicit flush.... If the FS layout needs to change all one would have to do is turn down the TTL, make the change, and turn it back up after the cache is sure to be cleared...
Hmm.. if I understand correctly then one can only turn it down to 1 second as 0 means unlimited. So if an application changes the tree it would have to sleep(1) for it to happen. I'd strongly suggest that we have an explicit flush option. And no, I don't think restarting the server is an opton as this can't be done from inside an application. BTW: This needs to be well documented as running into caching problems can cause a very annoying debugging sessions due to the Heisenbug nature. Happened to more than one person I know with filesize() with missing clearstatcache() calls. One of PHP's main feature is programmer efficiency so we should be careful to add optimizations which make things harder for programmers. - Chris

« previous php.internals (#12932) next »