memory_cache
Version, currently 0.44 versions
- 0.4.1latestMar 27, 2021
- 0.4not indexedMar 28, 2021
- 0.3not indexedMar 28, 2021
- 0.2not indexedMar 28, 2021
github.com/kostya/memory_cache
Super simple in memory key-value storage with expires for Crystal.
Nothing has been indexed for 0.4 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:
memory_cache:
github: kostya/memory_cache
version: ~> 0.4Then run:
shards installshard.yml
No shard.yml has been indexed for 0.4. 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.
MemoryCache
Super simple in memory key-value storage with expires for Crystal.
Installation
Add this to your application's shard.yml:
dependencies:
memory_cache:
github: kostya/memory_cache
Usage
require "memory_cache"
cache = MemoryCache(String, Int32).new
cache.write("bla", 1)
p cache.read("bla") # => 1
cache.fetch("haha") { 2 }
p cache.read("haha") # => 2
cache.write("expired1", 1, expires_in: 1.second)
p cache.read("expired1") # => 1
sleep 1
p cache.read("expired1") # => nil
p cache.fetch("expired1", expires_in: 1.second) { 2 } # => 2
p cache.fetch("expired1", expires_in: 1.second) { 3 } # => 2
sleep 1
p cache.fetch("expired1", expires_in: 1.second) { 3 } # => 3
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.4- Tagged
- Mar 28, 2021
- Commit
5a3339a2edfa- Indexed
- not yet
Dependents
Repository
github.com/kostya/memory_cache
Metadata
- Created
- Aug 12, 2026
- Updated
- Oct 24, 2026
- Synced
- Oct 24, 2026
- Versions
- 4