Author: joes
Date: Tue Mar 18 16:19:46 2014
New Revision: 1578957
URL: http://svn.apache.org/r1578957
Log:
caching
Modified:
thrift/cms-site/trunk/lib/path.pm
Modified: thrift/cms-site/trunk/lib/path.pm
URL:
http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/path.pm?rev=1578957&r1=1578956&r2=1578957&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/path.pm (original)
+++ thrift/cms-site/trunk/lib/path.pm Tue Mar 18 16:19:46 2014
@@ -6,6 +6,7 @@ use strict;
use warnings;
my $conf = Load(join "", <DATA>);
+my %memo; # maintain a page generation cache
our @patterns = (
[qr!^/docs\.md(?:text)?$!, dir_wrapper => {
@@ -13,9 +14,18 @@ our @patterns = (
template => 'default.html',
view => 'single_narrative',
dir => "/docs/", # trailing slash required
+ memo => \%memo,
+ }],
+ [qr!^/sitemap\.html$!, sitemap => {
+ conf => $conf,
+ headers => { title => "Sitemap" },
+ memo => \%memo,
+ }],
+ [qr/\.md(?:text)?$/, single_narrative => {
+ conf => $conf,
+ template => 'default.html',
+ memo => \%memo,
}],
- [qr!^/sitemap\.html$!, sitemap => {conf => $conf, headers => { title =>
"Sitemap" }}],
- [qr/\.md(?:text)?$/, single_narrative => {conf => $conf, template =>
'default.html'}],
);
my @mdfiles;