aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/trail.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-01-24 10:40:35 +1100
committerJoey Hess <joey@kitenet.net>2013-01-24 10:40:35 +1100
commite5d82ef8680dce98b3afab43605d7b278c98c789 (patch)
treec3d292160a417c352354ec65d07652d983eca954 /IkiWiki/Plugin/trail.pm
parent066cabd5a6ec6d1411fb61494659854c2f864a0f (diff)
downloadikiwiki-e5d82ef8680dce98b3afab43605d7b278c98c789.tar
ikiwiki-e5d82ef8680dce98b3afab43605d7b278c98c789.tar.gz
trail: Avoid massive slowdown caused by pagetemplate hook when displaying dynamic cgi pages, which cannot use trail anyway.
This seemed to be due to the pagetemplate hook calling prerender. I've observed this making it take *minutes* for the signin page to be displayed. ltracing ikiwiki showed it was matching pagespecs a lot. It may be that this is still a speed pain point when rendering pages, not just for CGI. So more work may be needed here.
Diffstat (limited to 'IkiWiki/Plugin/trail.pm')
-rw-r--r--IkiWiki/Plugin/trail.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/trail.pm b/IkiWiki/Plugin/trail.pm
index cb94855fd..d5fb2b5d6 100644
--- a/IkiWiki/Plugin/trail.pm
+++ b/IkiWiki/Plugin/trail.pm
@@ -411,6 +411,8 @@ sub pagetemplate (@) {
my $page = $params{page};
my $template = $params{template};
+ return unless length $page;
+
if ($template->query(name => 'trails') && ! $recursive) {
prerender();