Skip to content

Conversation

dhh
Copy link
Member

@dhh dhh commented Dec 20, 2024

Most Rails applications use etags to some extent. We should therefore make it the default to include the importmap digest in that calculation on HTML requests. So we turn:

class ApplicationController < ActionController::Base
  etag { Rails.application.importmap.digest(resolver: helpers) if request.format&.html? }
end

...into:

class ApplicationController < ActionController::Base
  stale_when_importmap_changes
end

And we can add that add that to be part of the default ApplicationController in Rails when using import maps.

@dhh dhh merged commit 2ef81f0 into main Dec 21, 2024
40 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant