module EtagWithTemplateDigest
Ruby on Rails 7.2.3
Since v4.2.9Action Controller Etag With Template Digest
When our views change, they should bubble up into HTTP cache freshness and bust browser caches. So the template digest for the current action is automatically included in the ETag.
Enabled by default for apps that use Action View. Disable by setting
config.action_controller.etag_with_template_digest = false
Override the template to digest by passing :template to fresh_when and stale? calls. For example:
# We're going to render widgets/show, not posts/show fresh_when @post, template: 'widgets/show' # We're not going to render a template, so omit it from the ETag. fresh_when @post, template: false
Includes
Extends
Private methods
(3)
Implementation detail — not part of the public API.
Methods (inherited)
From ActionController::ConditionalGet (6)
- # expires_in
- # expires_now
- # fresh_when
- # http_cache_forever
- # no_store
- # stale?
From ActiveSupport::Concern (3)
- # class_methods
- # included
- # prepended
From ActionController::Head (1)
- # head