Module: ActionDispatch::Http::Cache::Response
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
ActionController::Live::Response,
::ActionController::LiveTestResponse,
::ActionController::TestResponse,
::ActionDispatch::Response,
::ActionDispatch::TestResponse
| |
Defined in: | actionpack/lib/action_dispatch/http/cache.rb |
Constant Summary
-
CACHE_CONTROL =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 95"Cache-Control".freeze
-
DATE =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 92'Date'.freeze
-
DEFAULT_CACHE_CONTROL =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 135"max-age=0, private, must-revalidate".freeze
-
ETAG =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 94"ETag".freeze
-
LAST_MODIFIED =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 93"Last-Modified".freeze
-
MUST_REVALIDATE =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 139"must-revalidate".freeze
-
NO_CACHE =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 136"no-cache".freeze
-
PRIVATE =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 138"private".freeze
-
PUBLIC =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 137"public".freeze
-
SPECIAL_KEYS =
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 96Set.new(%w[extras no-cache max-age public must-revalidate])
Instance Attribute Summary
- #cache_control readonly
- #date rw
- #date=(utc_time) rw
- #date? ⇒ Boolean rw
- #etag=(etag) rw
-
#etag?
rw
Alias for #etag.
- #last_modified rw
- #last_modified=(utc_time) rw
- #last_modified? ⇒ Boolean rw
Instance Method Summary
- #etag (also: #etag?) rw
Instance Attribute Details
#cache_control (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/cache.rb', line 54
attr_reader :cache_control, :etag
#date (rw)
[ GitHub ]#date=(utc_time) (rw)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/cache.rb', line 81
def date=(utc_time) headers[DATE] = utc_time.httpdate end
#date? ⇒ Boolean
(rw)
[ GitHub ]
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 77
def date? headers.include?(DATE) end
#etag=(etag) (rw)
[ GitHub ]#etag? (rw)
Alias for #etag.
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 55
alias :etag? :etag
#last_modified (rw)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/cache.rb', line 57
def last_modified if last = headers[LAST_MODIFIED] Time.httpdate(last) end end
#last_modified=(utc_time) (rw)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/cache.rb', line 67
def last_modified=(utc_time) headers[LAST_MODIFIED] = utc_time.httpdate end
#last_modified? ⇒ Boolean
(rw)
[ GitHub ]
# File 'actionpack/lib/action_dispatch/http/cache.rb', line 63
def last_modified? headers.include?(LAST_MODIFIED) end
Instance Method Details
#etag (rw) Also known as: #etag?
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/cache.rb', line 54
attr_reader :cache_control, :etag