Methods
Public Class
Public Instance
Attributes
cached_response | [RW] |
points to a previously cached |
Public Class methods
new(*)
[show source]
# File lib/httpx/plugins/response_cache.rb 189 def initialize(*) 190 super 191 @cached_response = nil 192 end
Public Instance methods
cacheable_verb?()
returns whether this request is cacheable as per HTTP caching rules.
[show source]
# File lib/httpx/plugins/response_cache.rb 200 def cacheable_verb? 201 CACHEABLE_VERBS.include?(@verb) 202 end
merge_headers(*)
[show source]
# File lib/httpx/plugins/response_cache.rb 194 def merge_headers(*) 195 super 196 @response_cache_key = nil 197 end
response_cache_key()
returns a unique cache key as a String identifying this request
[show source]
# File lib/httpx/plugins/response_cache.rb 205 def response_cache_key 206 @response_cache_key ||= begin 207 keys = [@verb, @uri] 208 209 @options.supported_vary_headers.each do |field| 210 value = @headers[field] 211 212 keys << value if value 213 end 214 Digest::SHA1.hexdigest("httpx-response-cache-#{keys.join("-")}") 215 end 216 end