Skip to content

Instantly share code, notes, and snippets.

@julianrubisch
Created July 9, 2024 19:48
Show Gist options
  • Save julianrubisch/9fc865ac94f52c54ae26cc68f0db7b7d to your computer and use it in GitHub Desktop.
Save julianrubisch/9fc865ac94f52c54ae26cc68f0db7b7d to your computer and use it in GitHub Desktop.
Sitepress::Cache
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