SID-01844: Setup a topic to be rendered in the background
| Status: |
Answered |
TWiki version: |
6.0.0 |
Perl version: |
Perl 5.14.2 |
| Category: |
CategoryTemplates |
Server OS: |
Ubuntu 12.10 |
Last update: |
12 years ago |
I have a
WebLeftBar that includes a tree of the whole site. In order to speed things up I'd like the tree to be generated in a background job and included on display instead of constructed anew on every page load.
I imagine that to do this I should make a Twiki topic that generates the tree. This will be loaded by a cron script every couple of seconds and written to disk. Then I modify the view template to include the generated page in
WebLeftBar.
Any tips? I'm sure this pattern has been applied by others so I thought I'd ask before implementing it anew.
Thanks
--
Michael Sprague - 2013-12-22
Discussion and Answer
I went ahead and wrote a little script that calls expandCommonVariables on the given topic and writes the result to disk. However, my web restricts
TWikiGuest access and the script appears to run as guest. How do I make a script run as admin?
--
Michael Sprague - 2013-12-26
Michael, I just wrote a blog post about this,
BlogEntry201312x1: How to cache a sidebar for better performance
--
Peter Thoeny - 2013-12-27
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.