Skip to content

NullTerminator/cacheable-presenters-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cacheable Plugin

This plugin allows russian doll / fragment caching of pom views

Usage in POMs

Start a cache block with a key like so:

cache :saved do
  title 'Foo'
end

Complex keys are supported. If an object responds to cache_key then that will be used for it. An object that responds to map will be expanded. As a last resort to_s is used.

cache [:saved, product] do
  title 'Product details'
end

Configuration

The cache function can be set to work with an apps implementation of caching. The function must take the key, options as arguments and a block for when there is a cache miss.

With Rails it will default to:

Voom::Presenters::Plugins::Cacheable::Settings.configure do |config|
  config.cache_func = Rails.cache.method(:fetch)
end

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages