[pmwiki-users] Speed up PmWiki

Thomas Bley thomas.bley at simple-groupware.de
Thu Aug 16 16:28:45 CDT 2007


Hello,

I've written a first draft with these features:
- static cache for pages with no authentication, only get-request (?n=xyz)
- handles page updates
- avoids caching if (:static off:) is used
- static pages can be defined with a regexp in config.php
- does not remove cached page on delete, rename, permission change
- does not handle clean urls (so only enablepathinfo=0)
- does not include ?clear_static_cache or ?recache_page
- does not include dependency check from (:static on 
dependant_page1|dependant_page2:)

// INSTALLTION
/*
0) copy staticcaches.php to <pmwiki-dir>/scripts/

1) edit config.php, add:
$StaticPageCacheDir = 'cache.s';
$EnablePathInfo = 0; // clean URLs not (yet) supported
$EnableStaticHTMLCache = 1; // active caching
$EnableStaticHTMLPages = "/Main\..+/"; // only cache pages in the Main 
group [or]
$EnableStaticHTMLPages = ""; // cache all pages
// if enabled, disable static cache for a page with (:static off:)

2) edit scrips/stdconfig.php, replace:
$pagename = ResolvePageName($pagename);
with:
$pagename = ResolvePageName($pagename);
include_once("$FarmD/scripts/staticcaches.php");

3) edit/add .htaccess:
# If charset needs to be UTF-8
AddCharset UTF-8 .html
# activate engine, only cache get request, make sure mod_rewrite is 
loaded in httpf.conf
# no clean urls, EnablePathInfo = 0
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET$
# absolute path to file, adapt pmwiki/ if necessary
RewriteCond %{DOCUMENT_ROOT}/pmwiki/cache.s/s_%{QUERY_STRING}.html -f
RewriteRule pmwiki.php cache.s/s_%{QUERY_STRING}.html [QSA,L]
*/

Regards,
Thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20070816/9bacb258/attachment.html 


More information about the pmwiki-users mailing list