Module: ExpoTurbo::Rails::Caching::Helper

Includes:
Format::Helper
Defined in:
lib/expo_turbo/rails/caching.rb

Overview

Vary protects a shared HTTP cache. It does not protect Rails.cache: a fragment gated on a module version, or rendered for one Frame, can be read back for a different client. This helper folds the same vocabulary identity into every fragment key of an Expo Turbo render, and leaves HTML fragment keys unchanged.

Instance Method Summary collapse

Instance Method Details

#cache_fragment_name(name = {}, skip_digest: nil, digest_path: nil) ⇒ Object



14
15
16
17
18
# File 'lib/expo_turbo/rails/caching.rb', line 14

def cache_fragment_name(name = {}, skip_digest: nil, digest_path: nil)
  return super unless expo_turbo_render?

  super([name, *controller.expo_turbo_cache_variant], skip_digest:, digest_path:)
end