Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/regru/template-context-cacheable
https://github.com/regru/template-context-cacheable
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/regru/template-context-cacheable
- Owner: regru
- Created: 2012-09-05T12:29:58.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-27T08:52:48.000Z (over 12 years ago)
- Last Synced: 2024-04-17T05:50:33.464Z (9 months ago)
- Language: Perl
- Size: 117 KB
- Stars: 0
- Watchers: 29
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
Template::Context::Cacheable - profiling/caching-aware version of
Template::ContextSYNOPSIS
use My::Favourite::Cache::Engine;
use Template::Context::Cacheable;
Template::Context::Cacheable::configure_caching(
\&My::Favourite::Cache::Engine::get,
\&My::Favourite::Cache::Engine::put,
);DESCRIPTION
Enables profiling and caching of Template-Toolkit subtemplates, that can
improve template processing speed many times.Using in templates
Inside any template you can use cached subtemplates. See example:[% PROCESS subtemplate.tt
param_name_1 = 'value_1'
param_name_2 = 'value_2'
__cache_time = 60
%]Here __cache_time parameter enables caching and sets caching time in
seconds. If __cache_time value is negative, subtemplated will be cached
forever (actually it will be cached for 12 hours ;)param_name_X is examples of parameters, which combination will be used
as a hash key.FUNCTIONS / METHODS
The following functions / methods are available:configure_caching ( cache_get_ref, cache_put_ref )
Install cache get / put handlers.Here are protypes for get / put handlers which illustrates parameters
which they will receive:sub get { my ($key) = @_;
...
}sub set { my ($code, $key, $keep_in_seconds) = @_;
...
}process ( self )
Overloaded Template::Context::process methodEXPORT
No functions is exported.AUTHOR
Walery Studennikov, ""COPYRIGHT & LICENSE
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.