---json { "canonical": ":page:cache", "name": "Page Cache", "page_id": "p46nws4v027jel84v4a9m" } --- ====== How the page cache is working ?====== ===== About ===== This page is talking about the cache management of a page. A page is composed of: * its content * and the [[docs:theme:slot:slot|slots]] of [[:docs:theme:template:template|its template]]. Each rendering goes into the cache until: * its content has changed * its [[docs:metadata:metadata|metadata]] has changed * any [[docs:app:configuration|app configuration]] has changed * a [[docs:cache:slot|cache dependency]] has occurred * the [[#expiration date|expiration date]] is due. ===== Expiration Date ===== You can set the expiration date of a page with two methods: * by page with the [[#expiration frequency]] * globally with the [[#cache time interval]] (maximum age) ==== Expiration Frequency ==== If you need to delete the page cache at interval because your page contains time-based data, you can use the [[docs:cache:page_expiration_frequency|page cache expiration frequency]]. ==== Cache time interval ==== The ''cache time'' interval is a standard dokuwiki [[docs:app:configuration|application configuration]] that sets a maximum age for the cache file. If the interval has expired since the last creation date of the cache, the cache has expired and there is a cache miss. You can read more on the [[doku>config:cachetime|Dokuwiki dedicated page]]. ===== Purge Manually ===== By adding the ''purge'' property to a page URL, you will purge the cache for this particular page. Example for this page: [[${path}?purge|${url}?purge]] ===== Monitoring ===== In the [[viewer|cache viewer]], you can see all cache hit or miss for the [[docs:theme:slot:slot|slots]]. For each slot, you can see the cache: * for the parsing instructions (the parse tree) * for the html page * for the [[docs:metadata:metadata|metadata]] After 2 rendering, you should see only cache hits. * the first rendering will do the initial work * the second one should be only cache hit {{:docs:cache:combostrap_cache_hit.png|}} If the second request does not hit the cache, this is because a metadata may have been set by a third party plugin. ===== Support and Configuration ===== ==== useHeading ==== The [[doku>conf:useheading|useheading]] dokuwiki configuration has an impact on cache management, you should set disable it and set the value ''never''. More information on the [[support:useheading|dedicated page of this configuration]]