From a25a75bbe892276171945e3452cf78458d52cdc3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 22 Apr 2020 19:40:24 +0200 Subject: [PATCH] Ensure action caching includes GET params By default the auto-generated action cache keys looks like this: `views/0.0.0.0:3000/api/order_cycles/1/properties` With this change the cache keys now look like this: `views/0.0.0.0:3000/api/order_cycles/1/properties?distributor=3` --- app/controllers/api/order_cycles_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/order_cycles_controller.rb b/app/controllers/api/order_cycles_controller.rb index e2bca5a626..f92927b0fe 100644 --- a/app/controllers/api/order_cycles_controller.rb +++ b/app/controllers/api/order_cycles_controller.rb @@ -5,7 +5,9 @@ module Api skip_authorization_check - caches_action :taxons, :properties, expires_in: CacheService::FILTERS_EXPIRY + caches_action :taxons, :properties, + expires_in: CacheService::FILTERS_EXPIRY, + cache_path: proc { |controller| controller.request.url } def products products = ProductsRenderer.new(