From 9d9828246e79b807e81d6cfa0b3e654e49c5d4ef Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 13 Oct 2024 12:49:59 +1100 Subject: [PATCH] Allow page caching to be toggled --- config/settings.rb | 2 +- lib/adamantium/view_cache/cacher.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/settings.rb b/config/settings.rb index aa167be..7264c07 100644 --- a/config/settings.rb +++ b/config/settings.rb @@ -77,7 +77,7 @@ module Adamantium setting :gist_client_token, default: nil - setting :cache_pages, default: true + setting :cache_pages, default: false setting :steam_api_key, default: nil setting :steam_user_id, default: nil end diff --git a/lib/adamantium/view_cache/cacher.rb b/lib/adamantium/view_cache/cacher.rb index 87c9136..447bf7d 100644 --- a/lib/adamantium/view_cache/cacher.rb +++ b/lib/adamantium/view_cache/cacher.rb @@ -7,7 +7,7 @@ module Adamantium def call(key:, params:, content_proc:, expiry:) calculated_key = "adamantium:#{key}_#{params.join("_")}" - cached_content = cache_store.read(key: calculated_key) + cached_content = cache_store.read(key: calculated_key) if settings.cache_pages return cached_content if cached_content