This is a log of new features of note in DWiki.
New: optional disk-based caching
Having run out of other ways to really improve performance, I added a disk-based caching infrastructure to DWiki and then put in two caches.
The real cache is the renderer cache, which stores the results of selected renderers (currently just the
wikitext
renderers). Via some glue it's also used to store the results of the filesystem walk that's the expensive bit ofblog::prevnext
.The Brute Force Cache is for dealing with Slashdotting style situations; it just caches complete requests for N seconds when the system seems to be under load. I also hijacked it as a convenient place to add extra caching for Atom feeds and to force this caching on software that doesn't do conditional GET.
(For more details, see Caching.)
This required a new storage pool class. Like the comment store, it uses a customized and restricted interface to write things (and a new interface to read them). The cache storage pool stores objects, not data blobs, using the cPickle module to make the swap back and forth. (This may be a mistake, but it's fast and easy.)
Since removing files in DWiki makes me nervous, I didn't bother to implement any sort of cache cleaning; you get to do that by hand. The cache has TTLs, and the renderer cache has validation layered on top of the cache object store, but when they detect something invalid they just ignore it. (On the other hand, the cache storage layer does use temporary files and
rename()
, so in a sense it's already removing files.)In theory the cache interface is generic, so later I can hook up a memcached setup or something without having to change higher-level code.
New: Text formatting via macros
I (ChrisSiebenmann) found myself with a genuine need for text set in HTML <strike>. Rather than try to invent a formatting setup for this that did not make me cringe, I just punted to the easy solution: macros that do text formatting.
So, DWiki now has grown the new macros:
ST
for the font styles DWiki didn't already have.C
for character entities, andShowCharEnts
to show the named entities we support.- because I was there anyways,
AB
for <abbr>, so I could have those cute inline abbreviation expansion things. Tragically <abbr> is not supported by IE 6 and less, soAB
may quietly change to generating <acronym> someday.- and finally,
IMG
to generate <img>. Width, height, and alt text is mandatory, and there is a hacky way to also roll title text in too. (Title text is optional.)Through special black magic,
ST
,C
, andAB
can be used in comments (the omission ofIMG
is deliberate). In theory this lets a commenter cause character set explosions, but in practice a bad commenter can just write UTF-8 directly (UTF-8 is the common and only sane character set choice, so).Implementing these as macros means that they have some limitations. You can't nest
C
,AB
, or a differently styledST
inside anST
, and currently none of them can be done inside link text ([[....]]
).These macros are a bit of a hack. It's relatively easy to implement bits of HTML this way, but I'm not sure if it's good design overall.