jpcache Single Page Flush Mod

A long time ago I sent a version of this single page flush modification to Jean-Pierre Deckers the author of jpcache.  He replied that he would incorporate this change in a future version.  Unfortunately this project has not been updated in a very long time.  Thus I've opted to release this modification directly.  At the time I sent this to JP, he had a concern regarding the flush value being fixed for all installations.  That issue has been corrected in this modification.  So what does it do?

If you use jpcache, you likely know one of the downsides is when you update a page, your changes won't be seen until the cache expires.  That might be alright in some cases, but what if you want it flushed immediately or worse, what if it's a non-expiring page?  Enter the single page flush.  The single page flush option allows you to pass a GET parameter (?flush=1 by default) to a cached page which then forces it to be flushed from the cache immediately and allows a modified page to be quickly and easily updated.

If this sounds useful to you, you can download jpcache V2.1pl here.  This is a drop in place replacement for jpcache V2.  The setup and operation is exactly the same with the exception of $JPCACHE_FLUSH_KEY being added to the jpcache-config.php file.  You simply need to setup this file the same as you have it for V2, add a unique value for $JPCACHE_FLUSH_KEY and then use ?flush=$JPCACHE_FLUSH_KEY value to flush a specific page.  Enjoy!
February 11, 2007 @ 10:08 am | Category:
comments powered by Disqus