Created
July 9, 2024 19:48
-
-
Save julianrubisch/9fc865ac94f52c54ae26cc68f0db7b7d to your computer and use it in GitHub Desktop.
Sitepress::Cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.config.after_initialize do | |
Sitepress::SiteController.include(Sitepress::HttpCaching) | |
end | |
module Sitepress::HttpCaching | |
extend ActiveSupport::Concern | |
included do | |
before_action do | |
fresh_when current_resource.asset.updated_at if !!current_resource.data["cache"] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment