projects
/
irspy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a50cdc1
)
Use HTML::Mason caching to avoid repeated computation.
author
Mike Taylor
<mike@indexdata.com>
Fri, 15 Dec 2006 14:37:03 +0000
(14:37 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Fri, 15 Dec 2006 14:37:03 +0000
(14:37 +0000)
Quite neat, actually :-)
web/htdocs/details/stats.mc
patch
|
blob
|
history
diff --git
a/web/htdocs/details/stats.mc
b/web/htdocs/details/stats.mc
index
2522ede
..
fad2c11
100644
(file)
--- a/
web/htdocs/details/stats.mc
+++ b/
web/htdocs/details/stats.mc
@@
-1,4
+1,4
@@
-%# $Id: stats.mc,v 1.2 2006-12-15 10:37:29 mike Exp $
+%# $Id: stats.mc,v 1.3 2006-12-15 14:37:03 mike Exp $
<%doc>
Here are the headings in the Z-Spy version:
The ten most commonly supported Bib-1 Use attributes
<%doc>
Here are the headings in the Z-Spy version:
The ten most commonly supported Bib-1 Use attributes
@@
-18,7
+18,15
@@
records in order to find all the results, so we just take the path of
least resistance and look at all the records by hand.
</%doc>
<%perl>
least resistance and look at all the records by hand.
</%doc>
<%perl>
-my $stats = new ZOOM::IRSpy::Stats("localhost:3313/IR-Explain---1");
+my $stats = $m->cache->get("stats");
+if (defined $stats) {
+ print "<h2>Reusing cached result</h2>\n";
+ print "stats=$stats\n";
+} else {
+ print "<h2>Recalculating stats</h2>\n";
+ $stats = new ZOOM::IRSpy::Stats("localhost:3313/IR-Explain---1");
+ $m->cache->set("stats", $stats, "1 minute");
+}
print "<pre>";
$stats->print();
print "</pre>\n";
print "<pre>";
$stats->print();
print "</pre>\n";