[wp-hackers] overriding the built-in cache

Ryan Boren ryan at boren.nu
Fri Jan 6 02:12:23 GMT 2006

On Thu, 2006-01-05 at 20:48 -0500, Mark Jaquith wrote:
> Probably better to just save the cache again after the shutdown hook  
> is run.  If there's nothing to save, it should be really quick, and  
> it's a shutdown function anyway, so it shouldn't contribute to page  
> delay.  That would be the most backwards-compatible way of doing it.   
> I thought about just moving the query save function to AFTER the  
> shutdown hook, but that could be dangerous.  Shutdown functions don't  
> output errors to the browser when they screw up, so they're hard to  
> troubleshoot... and (at least, AFAIK) if you get a fatal error before  
> the cache is saved, you lose the changes that were made.  So my vote  
> goes to sandwich the shutdown hook between two cache saves.


I didn't make a sandwich because two consecutive calls to
wp_cache_close() might not agree with other cache backends.  It's fine
with the default cache, but we can't assume the default cache is being


More information about the wp-hackers mailing list