[pmwiki-users] HtmlCache, Internationalizazion, layout problem

Thomas Bley thbley at gmail.com
Tue Jul 18 17:57:32 CDT 2006


Thanks,

What about using a page directive to enable/disable caching: (analog to 
"(:title blabla:)"):
(:url_cache time=3600:)

This settings allows a page to be cached as Html. The cache file is used 
for 1 hour.
So each author can decide if the page is cached or not. Also a setting 
per Group may be possible.

Plus sth like this at the begin of pmwiki.php:

$cache_file = "cache/".sha1($_SERVER["REQUEST_URI"]).".html";
if (file_exists($cache_file) and filectime($cache_file)+3600 > time()) {
  echo file_get_contents($cache_file);
  exit;
}

This would be very good for pages that don't change very often, but get 
viewed very frequently by the users.
On my site there are ~60000 views per month and ~40000 go only to the 
first page (which has many includes). So if I cache it better, the whole 
machine speeds up.

bye
Thomas


>> - What is $EnableHTMLCache ? Can I use this flag to 
>> cache my pages as Html to disc ?
>>     
>
> $EnableHTMLCache is still experimental.  Yes, when enabled (and when
> $PageCacheDir is set) it causes PmWiki to cache (some) pages as html 
> rather than re-generating each page from the markup source on each 
> access.
>
> It remains "experimental" because, on pmwiki.org at least, I found
> that caching the HTML was actually slowing things down a bit, because
> of the latency required to write the cache files.  While this seems
> totally counter-intuitive, it may be tied to the way my virtual
> private server was configured in February.  (On the other hand,
> performance has vastly improved for pmwiki.org since then, so it
> may simply have been that my VPS was misconfigured.)
>
> It's also important to note that there are a lot of pages that
> cannot be reliably cached.  This includes any pages that have
> author-specific settings of any sort, including pages with
> read passwords, auth-based conditional markup, etc.  So, it
> doesn't seem to be as useful as might be expected at first.
>   





More information about the pmwiki-users mailing list