module Turbo::DriveHelper

def turbo_exempts_page_from_cache

Cannot be used along with +turbo_exempts_page_from_preview+.
Pages that are more likely than not to be a cache miss can skip turbo cache to avoid visual jitter.
def turbo_exempts_page_from_cache
  provide :head, tag.meta(name: "turbo-cache-control", content: "no-cache")
end

def turbo_exempts_page_from_preview

Cannot be used along with +turbo_exempts_page_from_cache+.
Specify that a cached version of the page should not be shown as a preview during an application visit.
def turbo_exempts_page_from_preview
  provide :head, tag.meta(name: "turbo-cache-control", content: "no-preview")
end

def turbo_page_requires_reload

Force the page, when loaded by Turbo, to be cause a full page reload.
def turbo_page_requires_reload
  provide :head, tag.meta(name: "turbo-visit-control", content: "reload")
end