diff --git a/app/services/cache_service.rb b/app/services/cache_service.rb index 79d81068eb..682911457e 100644 --- a/app/services/cache_service.rb +++ b/app/services/cache_service.rb @@ -36,5 +36,19 @@ class CacheService def self.ams_all_properties_key "inject-all-properties-#{CacheService.latest_timestamp_by_class(Spree::Property)}" end + + def self.ams_shops + [ + "shops/index/inject_enterprises", + { expires_in: SHOPS_EXPIRY } + ] + end + + def self.ams_shop(enterprise) + [ + "enterprises/shop/inject_enterprise_shopfront-#{enterprise.id}", + { expires_in: SHOPS_EXPIRY } + ] + end end end diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index b6bf91ed06..1bc7bba978 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -6,7 +6,7 @@ = current_distributor.logo.url - content_for :injection_data do - - cache "enterprises/shop/inject_enterprise_shopfront-#{@enterprise.id}", expires_in: CacheService::SHOPS_EXPIRY do + - cache(*CacheService::FragmentCaching.ams_shop(@enterprise)) do = inject_enterprise_shopfront(@enterprise) %shop.darkswarm diff --git a/app/views/shops/index.html.haml b/app/views/shops/index.html.haml index 0bf7709674..032096ebb9 100644 --- a/app/views/shops/index.html.haml +++ b/app/views/shops/index.html.haml @@ -2,7 +2,7 @@ = t :shops_title - content_for :injection_data do - - cache "shops/index/inject_enterprises", expires_in: CacheService::SHOPS_EXPIRY do + - cache(*CacheService::FragmentCaching.ams_shops) do = inject_enterprises(@enterprises) #panes