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.

Added more information about Serializer caching

Damian Legawiecb94c367ac2fe
diff --git a/api/app/serializers/spree/api/v2/base_serializer.rb b/api/app/serializers/spree/api/v2/base_serializer.rb
index 1f7c3a5665..ad73649663 100644
--- a/api/app/serializers/spree/api/v2/base_serializer.rb
+++ b/api/app/serializers/spree/api/v2/base_serializer.rb
@@ -4,6 +4,9 @@ module Spree
class BaseSerializer
include JSONAPI::Serializer
+ # to learn more about caching, please refer to:
+ # https://github.com/jsonapi-serializer/jsonapi-serializer#caching
+ # https://guides.rubyonrails.org/caching_with_rails.html#low-level-caching
cache_options(store: Rails.cache, namespace: 'jsonapi-serializer', expires_in: Spree::Api::Config[:api_v2_cache_ttl])
def self.record_cache_options(options, fieldset, include_list, params)