This Plugin is for you if you have a page that loads very slow because of
TWikiVariables like
%SEARCH{}% and
%INCLUDE{}%. Enjoy.
An alternative is the
FormQueryPlugin.
--
PeterThoeny - 16 Jul 2004
There is a typo in the
VarCachePlugin page in that this is spelled
%VARCACHR%.
I have difficulties understanding the documentation:
- It is said that the
%VARCACHE% variable gets replaced with one of the above (in the documentation table) messages. What is shown if neither the cachemsg nor the updatemsg variable are present? I would expect that the variable is expanded into the default messages in that case.
- If that is the correct interpretation, you might want to state that in the documentation,
- To the default as indicated in the Default column -- PTh
- however, this is not what I observe at VarCachePluginTest. From VarCachePluginTest it appears that no expansion takes place.
- This Plugin is not installed on TWiki.org -- PTh
- Also, what is unclear whether the cache is refreshed automatically after the indicated time, or whether the cache is refreshed on the next topic load after the cache expired.
- On next topic load. As indicated, The cache gets updated automatically when looking at a topic that has an outdated cache; in which case the user will notice a slower page rendering then usual. -- PTh
--
ThomasWeigert - 16 Jul 2004
Thanks for the feedback, I will work on the docs. It can be hard to write good docs.
--
PeterThoeny - 16 Jul 2004
This looks like an excellent plugin - some of the other cache strategies presented, that caches the entire HTML etc, bring new headaches with skins etc - this idea sounds promising.
Two questions:
- Can anything be done about the ModPerl issue (with
$paramMsg) mentioned in VarCachePlugin.pm?
- There is a security issue if this plugin is used in topics with protected information - topic text can now be retrieved through the
/pub dir (i.e. .../pub/TWiki/VarCachePluginTest/_VarCachePlugin_cache.txt). I believe it's acceptable, but making people more aware of this effect up front wouldn't hurt, I think(?).
--
SteffenPoulsen - 01 Apr 2005
mod_perl issue: There is a potential race condition within variable expansion of a page (e.g. time taken between beforeCommonTagsHandler and afterCommonTagsHandler. If two pages are viewed and updated at the exact same time, one page might show an incorrect message. At this time I do not have a workaround. Note that this issue does not affect the actual caching, only the short cache result message.
Security issue: Yes, cache pages can be protected with a Apache config setting. Should be documented in the next release.
--
PeterThoeny - 03 Apr 2005
checked
.zip into
CVS
--
WillNorris - 19 Jul 2005
Does this plugin actually work in TWiki4?
I notice it is installed on this TWiki.org. Is the lack of TWiki4 compatibility a reason why twiki.org is still not upgraded to TWiki4?
--
KennethLavrsen - 02 Mar 2006
This Plugin plays by the rules and should work in Dakar, but I have not tried. (See
PluginsConformanceReport).
On TWiki.org upgrade, mainly a question of allocating time to do it. Not sure of Sven solved the outgoing e-mail issue with the ISP. Also, we need to decide on the auth options, balance between ease of use and security.
--
PeterThoeny - 02 Mar 2006
I hav been using it with Dakar (both beta and final) for several months without problems.
--
LynnwoodBrown - 02 Mar 2006
Didn't work for me on Dakar (4.0.1) as it references the non-existant
TWiki::getCgiQuery() function. Changed it to
TWiki::Func::getCgiQuery(); and now it works like a charm

see the attached
VarCachePlugin.pm.diff
--
MarcLangheinrich - 06 Mar 2006
The ZIP file on the Plugin topic was out of date. I made a few more doc changes and updated the ZIP to the 06 Jan 2006 version.
--
PeterThoeny - 06 Mar 2006
http://koala.ilog.fr/twikiirc/bin/irclogger_log/twiki?date=2006-07-11,Tue&sel=959#l955
MartinCleaver: That This topic is now cached ([[http://twiki.org/cgi-bin/view/Plugins/VarCachePluginDev?varcache=refresh][refresh]]) - its to make TWiki cache the search?
MartinCleaver: but it still registers as a hit?
PeterThoeny: yes
PeterThoeny: just the %VARS{}% are cached
MartinCleaver: is there a reason this not a meta data item?
MartinCleaver: (the directive to make it behave this way)
PeterThoeny: it uses the standard variable naming convention
MartinCleaver: I'd venture that a %META:VarCachePlugin:VARCACHE{168}% would be a better place for it.
MartinCleaver: it'd scare the living daylights out of any mortal editing the page
--
MartinCleaver - 11 Jul 2006
Suggested by
MichaelDaum: Add
rel="nofollow" to the refresh link to prevent robots from hitting the refresh link.
--
PeterThoeny - 20 Sep 2006
I used this plugin on an earlier version. We upgraded to 4.1 and it doesn't seem to work anymore which is quite unfortunate.
Can anyone confirm that it does not work on 4.1?
--
KaiMoorfeld - 11 May 2007
TWiki.org currenty runs 4.1.1 and this plugin works. Check your installation; please open a support question with details in the
Support web if needed.
--
PeterThoeny - 11 May 2007
Nice to have feature/enhancement request: Ability to show the "has been cached" message multiple times on the same topic. Useful if you have a big topic where you want to give the user the opportunity to refresh the page in several places. Can be done with a new
%VARCACHE{ showmsg="on" }% parameter, which only shows the message, but does not initiate a cache refresh action if the cache is outdated. If the user lists multiple VARCACHE on teh same topic, it must be ensured that the cache is only refreshed once.
--
PeterThoeny - 11 May 2007
A bit of feedback:
- This plugin currently stores the cached topic in the
pub directory. Should really be in the work area.
- When it caches the TwistyPlugin (or any plugin that adds javascript or css files to the head), the imports are lost. Is there any way for the VarCachePlugin to know what needs to be added to the head and to add those even when the topic is cached? I suspect this wont be easy, but if anyone has any pointers then I don't mind looking into it. Maybe this could help: ProcessAddToHeadAdds
Thanks for the plugin.
--
AndrewRJones - 09 Aug 2007
The
pub directory is the recommended storage area up to the Cairo release. This plugin currently runs on Cairo and TWiki 4.x. Long time passed since TWiki 4 release, so it makes sense to make this plugin require TWiki 4, and to move the plugin data to the plugin work area.
Ah, yes, javascript and css in head, that needs to be added. I ahve no time to look into this.
--
PeterThoeny - 12 Aug 2007
It would be nice if INCLUDEd page parts could be cached. So I can have a VARCACHE in the left bar to speed up all page views.
--
ArthurClemens - 13 Mar 2008
Good idea. There would be some limitations though, for example, the login user name would be cached. This could be addressed by specifying what should
not be cached.
--
PeterThoeny - 13 Mar 2008