Provides caching for Lucky app and particularly for html caching.
-
Add the dependency to your
shard.yml:dependencies: lucky_cache: github: matthewmcgarvey/lucky_cache
-
Run
shards install -
Create a
config/cache.crand add:
LuckyCache.configure do |settings|
settings.cache = Cache::MemoryStore(String, String).new(expires_in: 30.minutes)
end
module Lucky::HTMLBuilder
include LuckyCache::HtmlHelpers
endrequire "lucky_cache"cache("key") do
para "hello, world"
end- Use
Avram::Modeland queries as keys
TODO: Write development instructions here
- Fork it (https://github.com/matthewmcgarvey/lucky_cache/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
- Matthew McGarvey - creator and maintainer