[dokuwiki] Re: Remove a page from the cache

  • From: lilive <lilivve@xxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 08 Dec 2009 16:30:29 +0100


To be short, my question is :
Is it a way to purge the cache for a given page, from the handle method of a syntax plugin ? (the page to remove from the cache is not the page for which the handle method is called)

<snip>

That's why I'm looking for a way to remove a page from the cache, in the handle method of the dataentry class.


Christopher Smith wrote :dokuwiki cache doesn't work by expiring individual pages. Instead it verifies the validity of the cache before using it.

1. Update the mtime of metadata file. The cached HTML is dependent on the metadata file. If the cache is older than the metadata it won't be valid. You can update metadata by either touching the file or setting some metadata value of your own. This is the best method to use if its only the html that needs to be refreshed - in plugin terms you're calling render() but not handle().

Fresh off the press, http://www.dokuwiki.org/devel:caching#individual_page_cache_expiry
Thank you Christopher,
I successfully applied the http://www.dokuwiki.org/devel:caching#individual_page_cache_expiry method. This is a great improvement for my custom version of the data plugin.
And thank you too for the explanations about the cache system.

Cheers,
Lilive.


global $INFO;
touch($INFO['filepath']); //touching the time stamp will invalid the cache
to force DW to load the page into cache again.

Regards

James

And thank you James :)



--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: