[Home]HtmlCache

UseModWiki | RecentChanges | Preferences

Note: I do not recommend using the HtmlCache feature except in extreme overload situations (like your wiki being [SlashDotted]). I am not highly confident that the cache works properly in all situations. (I know of one definite issue with the "random link" feature--cached versions will show/hide that link depending on the settings of the person who generated the cached versions, not the viewer of the cached version.) The Wikipedia project briefly tried using the HtmlCache feature (when they were using UseModWiki), but later decided it wasn't worth the trouble. --CliffordAdams

This feature is enabled with the UseCache variable.


The following text is from pre-implementation notes, but it is mostly accurate:

The usual problem with pre-generating or caching Wiki HTML is that links to NonDefinedPages? (like this one) could be defined at any time. The HTML for the page needs to be regenerated when other pages are defined.

My proposed solution:

When a browse request is sent, check for a HTML cache file. If the cache file exists, send it.

If the cache file does not exist, but a database entry exists, generate the HTML file and send it.

If neither the cache file nor the database entry exist, then edit the page as new.

When a new page is created, search all the existing pages for backlinks. Delete the HTML cache files for each page referencing the new page. The next user to browse each referencing page will recreate the HTML cache.

Edits to a page should recreate the cache file when saving the new page.

This plan may have a tiny race if a cache file is detected by a reader (which does not lock), and another user removes the file before/while the first user reads it.


Question: How do I refresh and update the HTML cache in the current release? I did not use the HTML cache for a while, and now that I am trying to again all the pages displayed are outdated. Thanks.

To refresh the cache, just remove all the files in the html directory (in your main wiki directory). The first visitor to a page will regenerate the cache file for that page. --CliffordAdams

Thanks, Clifford. It's working.


Why go through the perl script to reach a cached page? Why not save the cache pages as /pagename.html and give that URL directly? that way the script would only be called for edit pages, saving, RC, history and diffs -- Tarquin


UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 13, 2004 11:10 am by 62.213.86.109 (diff)
Search: