DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:smartcache

This is an old revision of the document!


Smartcache Plugin

Plugins by same author

Compatible with DokuWiki

2011-05-25

plugin Improve Dokuwiki speed by smart usage of the browser cache

Last updated on
2011-08-01
Provides
Action
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with ajax, cache

This plugin enable the browser cache for users that are not logged in. The cache is automatically refreshed (and checked) using an AJAX call to the server. If the user log in, the plugin also refresh the browser cache.

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

For some strange reason (anybody?), it is not possible to change the cache-headers using the event system. To get this plugin in to work you need to edit inc/actions.php: After the line : foreach ($headers as $hdr) header($hdr); insert:

if(!isset( $_SERVER['REMOTE_USER'])){
header('Cache-Control: public, max-age='.max($conf['cachetime'], 2000000));                          
header('Pragma: cache'); } 

To speed up the AJAX code; you need to hardcode the 'datadir' path in the ajax.php script from the plugin folder. E.g., if your 'datadir' is '/var/www/data/pages/', you need to write:

print  date ("m/d/Y H:i:s",filemtime(('/var/www/data/pages/'.(str_replace(':','/',$_POST['id'])).'.txt')));  

Change Log

[preferable GitHub RSS feed or similar]

  • 2011-08-01
    • Initial release

Discussion

Could be placed on an external page (e.g. plugin:pluginname:discussion) to have a distinction between user comments and author docs

plugin/smartcache.1312934461.txt.gz · Last modified: 2011-08-10 02:01 by 88.169.18.60

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki