Catalyst-Manual

 view release on metacpan or  search on metacpan

lib/Catalyst/Manual/Cookbook.pod  view on Meta::CPAN

We could actually cache the result forever, but using a value such as 12 hours
allows old entries to be automatically expired when they are no longer needed.

=head3 Page Caching

Another method of caching is to cache the entire HTML page.  While this is
traditionally handled by a frontend proxy server like Squid, the Catalyst
PageCache plugin makes it trivial to cache the entire output from
frequently-used or slow actions.

Many sites have a busy content-filled front page that might look something
like this.  It probably takes a while to process, and will do the exact same
thing for every single user who views the page.

    sub front_page : Path('/') {
        my ( $self, $c ) = @_;

        $c->forward( 'get_news_articles' );
        $c->forward( 'build_lots_of_boxes' );
        $c->forward( 'more_slow_stuff' );



( run in 0.582 second using v1.01-cache-2.11-cpan-87723dcf8b7 )