Methods
Constants
DEFAULT_CACHE_CONTROL | = | "max-age=0, private, must-revalidate" |
Attributes
[R] | cache_control |
Public Class methods
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 44 def initialize(*) status, header, body = super @cache_control = {} @etag = self["ETag"] if cache_control = self["Cache-Control"] cache_control.split(/,\s*/).each do |segment| first, last = segment.split("=") last ||= true @cache_control[first.to_sym] = last end end end
Public Instance methods
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 73 def etag @etag end
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 81 def etag=(etag) key = ActiveSupport::Cache.expand_cache_key(etag) @etag = self["ETag"] = %("#{Digest::MD5.hexdigest(key)}") end
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 77 def etag? @etag end
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 59 def last_modified if last = headers['Last-Modified'] Time.httpdate(last) end end
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 69 def last_modified=(utc_time) headers['Last-Modified'] = utc_time.httpdate end
[ show source ]
# File actionpack/lib/action_dispatch/http/cache.rb, line 65 def last_modified? headers.include?('Last-Modified') end