The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Nile::Plugin::Cache - Cache plugin for the Nile framework.

SYNOPSIS

    my $cash = $app->plugin->cache;

    # save visitors count to the cache
    $cash->set("visitor_count", $cash->get("visitor_count") + 1, "1 year");

    # retrieve visitors count from the cache
    $view->set("visitor_count", $cash->get("visitor_count"));
        

DESCRIPTION

Nile::Plugin::Cache - Cache plugin for the Nile framework.

Returns the CHI object. All CHI methods are supported.

Plugin settings in th config file under plugin section. The autoload variable is must be set to true value for the plugin to be loaded on application startup to setup hooks to work before actions dispatch:

    <plugin>

        <cache>
            <autoload>0</autoload>
            <driver>File</driver>
            <root_dir></root_dir>
            <namespace>cache</namespace>
        </cache>

    </plugin>

For DBI driver configuration example:

        <driver>DBI</driver>
        <namespace>cache</namespace>
        <table_prefix>cache_</table_prefix>
        <create_table>1</create_table>

The DBI create table example:

    CREATE TABLE <table_prefix><namespace> (
       `key` VARCHAR(...),
       `value` TEXT,
       PRIMARY KEY (`key`)
    )

The driver will try to create the table if you set create_table in the config and table does not exist.

Bugs

This project is available on github at https://github.com/mewsoft/Nile.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Nile.

SOURCE

Source repository is at https://github.com/mewsoft/Nile.

SEE ALSO

See Nile for details about the complete framework.

AUTHOR

Ahmed Amin Elsheshtawy, احمد امين الششتاوى <mewsoft@cpan.org> Website: http://www.mewsoft.com

COPYRIGHT AND LICENSE

Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy احمد امين الششتاوى mewsoft@cpan.org, support@mewsoft.com, https://github.com/mewsoft/Nile, http://www.mewsoft.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.