NAME

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

SYNOPSIS

my $cache = $app->plugin("Cache::Redis");

$cache->set("fullname", "Ahmed Amin Elsheshtawy");

$cache->get("fullname");

$cache->remove("fullname");

DESCRIPTION

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

Plugin settings in th config file under plugin section.

<plugin>

    <cache_redis>
        <server>localhost:6379</server>
        <namespace>cache:</namespace>
        <default_expires_in>2592000</default_expires_in>
    </cache_redis>

</plugin>

set()

$cache->set($key, $value, $expire)

Set a stuff to cache.

set_multi()

$cache->set_multi([$key, $value, $expire], [$key, $value])

Set multiple stuffs to cache. stuffs is array reference.

get()

my $stuff = $cache->get($key)

Get a stuff from cache.

get_multi()

my $res = $cache->get_multi(@keys)

Get multiple stuffs as hash reference from cache. @keys should be array. A key is not stored on cache don't be contain $res.

remove()

$cache->remove($key)

Remove stuff of key from cache.

get_or_set()

$cache->get_or_set($key, $code, $expire)

Get a cache value for $key if it's already cached. If it's not cached then, run $code and cache $expiration seconds and return the value.

nowait_push()

$cache->nowait_push

Wait all response from Redis. This is intended for $cache->nowait.

cache()

$cache->cache();

Returns the Cache::Redis object instance used. All Cache::Redis methods can be accessed through this method.

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.