Tags:
create new tag
, view all tags
Hello, all. I've been playing around with the GenHTML add-on and would like to generalize it (it currently has alot of params hard-coded into the script which I'm needing to change). If the CoreTeam is interested, I'll make it general enough to be incorporated into the core TWiki distro.

It would be better as part of the core distro and not as an add-on because I could also make a change to the bin/save script and the TWiki.cfg that would give admins the option of having the static html pages automatically generated after edits and redirect the user to the static page instead of the bin/view page.

If you are willing, I can have it done and to you guys within 2 weeks. Otherwqise I'll just make the changes specific to my local system and not care about generalization of the params smile

-- AdamTheo - 10 Dec 2002

Interesting idea and worth investigating. However, it's probably not the best time to get this into the core, just before BeijingRelease, and it should probably remain a plugin anyway since not everyone wants caching. Have a look at the existing CacheAddOn to see if this is a reasonable starting point, it works pretty well. Doing push-based cache filling is quite hard, try a google for suitable keywords to find earlier discussions - e.g. how do you ensure that all search-based pages are updated when a text page is updated?

-- RichardDonkin - 10 Dec 2002

Hmm... OK, but how would I intercept the bin/save script to redirect to the cache script instead of going back to the bin/view script? I read something about a onSave hook for plugins. Is this what I need?

-- AdamTheo - 11 Dec 2002

CacheAddOn isn't really what I have in mind. For one, it replaces the view script, which would damage any future enhancements to the bin scripts (such as the internationalization being done now). Also, it starts up perl and CGI no matter what, which I'd rather avoid. My idea is that all viewing is done off of static pages like a normal website. Only when a user wants to change something does perl and CGI get involved.

-- AdamTheo - 11 Dec 2002

Check out various CPAN modules available for caching. One of these would integrate directly into the TWiki's perl code and give much greater flexibility over controlling when to invalidate the cache and the cache size growth.

On another note, it also occurs to me that you could do a cache using Apache's mod_rewrite ability without OS shell involvement or dependence. The following is a small fragment from the mod_rewrite guide documentation which shows how to pull missing information from another server into an area.

RewriteRule ^/~([^/]+)/?(.*)          /home/$1/.www/$2
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule ^/home/([^/]+)/.www/?(.*) http://www2.quux-corp.dom/~$1/pub/$2 [P]

Basically, it says if the filename does not exist and it is not a directory, cache the information using the Proxy Throughput feature (flag [P]) into your area. Since mod_rewrite can do some amazing voodoo, a fairly robust cache or even a full mirror could be set up for any URL whatsoever, not just twiki. A good website for mod_rewrite resources is found at: http://www.modrewrite.com

-- TomKagan - 11 Dec 2002

>Plugins.CacheAddOn ... replaces the view script,
>which would damage any future enhancements
Don't hope so. It is just renamed away to catch any reference to view.

>Also, it starts up perl and CGI no matter what, which I'd rather avoid.
That was my vision as well.
But: you cannot avoid the trip to the server, if you want to make sure, that you catch each page edit.

Note
this is not necessary for the "normal" reader, but for the editor! When I experimented with client side caching, I found it very confusing, when the cached view shows up again after save,
  1. e. you have to 1.) preview 2.) save 3.) reload...
At least the replaced view does avoid running Perl. As the benchmark figures show, to CGI overhead for the shell script is not too bad.

The mod_rewrite stuff looks really cool and could improve performance on very loaded servers, where even CGI/sh is too heavy.

-- PeterKlausner - 11 + 13 Dec 2002

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2008-09-04 - TWikiJanitor
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.