Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed API `collection_cache_key` (#12131)

Damian Legawieca47d1b2498bc
diff --git a/api/app/controllers/concerns/spree/api/v2/caching.rb b/api/app/controllers/concerns/spree/api/v2/caching.rb
index d0e88b1874..ae16dccd7a 100644
--- a/api/app/controllers/concerns/spree/api/v2/caching.rb
+++ b/api/app/controllers/concerns/spree/api/v2/caching.rb
@@ -5,12 +5,10 @@ module Spree
extend ActiveSupport::Concern
def collection_cache_key(collection)
- collection_cache_key = collection.unscope(:includes).unscope(:order).unscope(:group).cache_key_with_version
-
params.delete(:page) if params[:page] == 1
cache_key_parts = [
- collection_cache_key,
+ collection.cache_key_with_version,
resource_includes,
sparse_fields,
serializer_params_cache_key,