CacheContentPlugin
This plugin puts any text between a
%STARTCACHE{"filename"}% and
%ENDCACHE% into an attachment with the given filename. If a topic and/or web is specified, the file will be attached to that instead.
The current version only refreshes the attachment when the topic is saved. Obviously this means that the attachment can get out of synch if, for example, it explicitly or implicitly refers to other topics.
I wrote this plugin specifically to be able to put my css into topic(s) and still be able to have efficient stylesheets; i.e., without the overhead of TWiki processing. There seem to be a number of other needs, however, and I'm happy to try and accomodate them!
Syntax Rules
Pretty simple. Just put in a
%STARTCACHE{"filename"}% before content you want cached, and
%ENDCACHE% after it, and the contents in between will be attached to the topic, for easy reference by other pages. You can optionally put in a topic and/or web.
Examples
%STARTCACHE{"style.css"}%
table.patternTopBarContents { padding:0; }
%ENDCACHE
%STARTCACHE{"style.css" topic="StyleSheet"}%
table.patternTopBarContents { padding:0; }
%ENDCACHE
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%CACHECONTENTPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the Text Formatting Rules topic:
- Set SHORTDESCRIPTION = Caches portions of a topic in attachments to that topic
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
CacheContentPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/CacheContentPlugin.txt | Plugin topic |
data/TWiki/CacheContentPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/CacheContentPlugin.pm | Plugin Perl module |
- Test if the installation was successful:
Plugin Info
Related Topics: T Wiki Preferences,
T Wiki Plugins
--
TWiki:Main.MeredithLesly - 09 Feb 2006