Net::TiVo is slow due to the amount of time it takes to fetch data from
TiVo. This is greatly sped up by using a cache. Net::TiVos new method
accepts a reference to a Cache object. Any type of caching object may be
supported as long as it meets the requirements below. There are several cache
implementations available on CPAN, such as Cache::Cache.
The following example creates a cache that lasts for 600 seconds.
my $cache = Cache::FileCache->new(
namespace => TiVo,
default_expires_in => 600,
my $tivo = Net::TiVo->new(
host => 192.168.1.25,
mac => MEDIA_ACCESS_KEY,
cache => $cache,
Net::TiVo uses positive caching, errors are not stored in the cache.
Any Cache class may be used as long as it supports the following method
# Set a cache value
# Get a cache value