lucky_cache
Version, currently 0.1.13 versions
- 0.2.0latestMar 19, 2026
- 0.1.1not indexedMar 19, 2026
- 0.1.0not indexedMar 19, 2026
github.com/luckyframework/lucky_cache
Caching library for the Lucky Framework
Nothing has been indexed for 0.1.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
lucky_cache:
github: luckyframework/lucky_cache
version: ~> 0.1.1Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.1. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
LuckyCache
Cache content within your Lucky application.
Installation
-
Add the dependency to your
shard.yml:dependencies: lucky_cache: github: luckyframework/lucky_cache -
Run
shards install
Adapters
LuckyCache comes with a built-in MemoryStore, but if you need extneral storage, check out one of these adapters
Usage
require "lucky_cache"
LuckyCache.configure do |settings|
settings.storage = LuckyCache::MemoryStore.new
settings.default_duration = 5.minutes
end
class SomeObject
include LuckyCache::Cachable
end
cache = LuckyCache.settings.storage
some_object = cache.fetch("some_key", as: SomeObject) do
SomeObject.new
end
Page fragment cache
You can cache portions of your page by including the LuckyCache::HtmlHelpers module
in your Page class, and use the cache() helper method.
class Posts::ShowPage < MainLayout
include LuckyCache::HtmlHelpers
needs post : Post
def content
cache("post:#{post.id}:comments", expires_in: 1.hour) do
post.comments.each do |comment|
div comment.text
end
end
end
end
Development
Contributing
- Fork it (https://github.com/luckyframework/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
Contributors
- Jeremy Woertink - maintainer
Thanks & attributions
- Initial structure and some code was pulled from the original LuckyCache by @matthewmcgarvey.
- Lots of inspiration on Cache store was from @mamantoha
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.1- Tagged
- Mar 19, 2026
- Commit
527e6c8a719e- Indexed
- not yet
Dependents
Repository
github.com/luckyframework/lucky_cache
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 3