Marten Memcached Cache provides a Memcached cache store that can be used with Marten web framework's cache system.
Simply add the following entry to your project's shard.yml:
dependencies:
marten_memcached_cache:
github: martenframework/marten-memcached-cacheAnd run shards install afterward.
First, add the following requirement to your project's src/project.cr file:
require "marten_memcached_cache"Then you can configure your project to use the Memcached cache store by setting the corresponding configuration option as follows:
Marten.configure do |config|
config.cache_store = MartenMemcachedCache::Store.new(host: "localhost", port: 11211)
endThe host and port arguments are optional and default respectively to localhost and 11211. It should be noted that this cache store also supports all the existing initialization options in addition to these arguments (eg. namespace, version, expires_in, etc). Please refer to the cache system documentation to learn more about Marten's caching framework.
Morgan Aubert (@ellmetha) and contributors.
MIT. See LICENSE for more details.