class Typhoeus::Cache::Dalli
This module provides a simple way to cache HTTP responses using Dalli.
def get(request)
def get(request) @client.get(request.cache_key) end
def initialize(client = ::Dalli::Client.new, options = {})
(**options)
-
:default_ttl
(Integer
) --
Parameters:
-
options
(Hash
) -- -
client
(Dalli::Client
) --
Other tags:
- Example: Set Dalli as the Typhoeus cache backend -
def initialize(client = ::Dalli::Client.new, options = {}) @client = client @default_ttl = options[:default_ttl] end
def set(request, response)
def set(request, response) @client.set(request.cache_key, response, request.cache_ttl || @default_ttl) end