From 6d343989dedd3c11f4e5315da1c7bdea60333ba3 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Mon, 15 Jan 2024 06:19:34 -0800 Subject: [PATCH] Extend OWLS caching from 15 minutes to 1 day Poking at the site, I didn't love that clicking any of the NC items on the homepage took a few seconds to load cuz of the OWLS request taking a couple seconds. If the request were faster to load I might decide otherwise, but for now, let's just keep that cache long. Another approach we could take would be to ask for an endpoint that returns all the values at once, so we could cache and update them all together, instead of having it all split into separate cache keys! --- app/services/owls_value_guide.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/owls_value_guide.rb b/app/services/owls_value_guide.rb index d541e0e0..8d51922f 100644 --- a/app/services/owls_value_guide.rb +++ b/app/services/owls_value_guide.rb @@ -8,7 +8,7 @@ module OwlsValueGuide def self.find_by_name(item_name) # Load the itemdata, pulling from the Rails cache if possible. cache_key = "OwlsValueGuide/itemdata/#{item_name}" - data = Rails.cache.fetch(cache_key, expires_in: 15.minutes) do + data = Rails.cache.fetch(cache_key, expires_in: 1.day) do load_itemdata(item_name) end