GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Catalyst::TraitFor::Model::DBIC::Schema::Caching(3) User Contributed Perl Documentation Catalyst::TraitFor::Model::DBIC::Schema::Caching(3)

Catalyst::TraitFor::Model::DBIC::Schema::Caching - Query caching support for Catalyst::Model::DBIC::Schema

    __PACKAGE__->config({
        traits => ['Caching'],
        connect_info => 
            ['dbi:mysql:db', 'user', 'pass'],
    });

    $c->model('DB::Table')->search({ foo => 'bar' }, { cache_for => 18000 });

Enable caching support using DBIx::Class::Cursor::Cached and Catalyst::Plugin::Cache.

In order for this to work, Catalyst::Plugin::Cache must be configured and loaded. A possible configuration would look like this:

  <Plugin::Cache>
    <backend>       
      class Cache::FastMmap
      unlink_on_exit 1
      share_file /tmp/myapp_share
    </backend>
  </Plugin::Cache>

Then in your queries, set the "cache_for" ResultSet attribute to the number of seconds you want the query results to be cached for, eg.:

  $c->model('DB::Table')->search({ foo => 'bar' }, { cache_for => 18000 });

Turn caching on or off, you can use:

    $c->model('DB')->caching(0);

Catalyst::Model::DBIC::Schema, DBIx::Class, Catalyst::Plugin::Cache, Cache::FastMmap, DBIx::Class::Cursor::Cached

See "AUTHOR" in Catalyst::Model::DBIC::Schema and "CONTRIBUTORS" in Catalyst::Model::DBIC::Schema.

See "COPYRIGHT" in Catalyst::Model::DBIC::Schema.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
2014-09-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.