From: Matt S Trout Date: Sat, 16 Jul 2011 20:22:54 +0000 (+0000) Subject: cache sidebar structure to avoid directory scans every request X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0fb543cdf1fbd8edf05c4020b853ee4ae73c72b6;p=scpubgit%2FSCS.git cache sidebar structure to avoid directory scans every request --- diff --git a/lib/SCSite/SidebarFilter.pm b/lib/SCSite/SidebarFilter.pm index 9ce5b81..64f804e 100644 --- a/lib/SCSite/SidebarFilter.pm +++ b/lib/SCSite/SidebarFilter.pm @@ -36,7 +36,9 @@ sub _latest_blog_posts { ->flatten; } -sub _sidebar_structure { +has _sidebar_structure => (is => 'lazy'); + +sub _build__sidebar_structure { my ($self) = @_; [ [ 'NEWS',