class Importmap::Map
def digest(resolver:)
etag { Rails.application.importmap.digest(resolver: helpers) if request.format&.html? }
class ApplicationController < ActionController::Base
Example:
ensure that a html cache is invalidated when the import map is changed.
Returns a SHA1 digest of the import map json that can be used as a part of a page etag to
def digest(resolver:) Digest::SHA1.hexdigest(to_json(resolver: resolver).to_s) end