QuestionQ19

Troubleshoot infrastructure and configuration issues

An existing Adobe Commerce website is being moved to a headless implementation.

The existing site includes an All Brands page and separate pages for every brand. All brand-related pages are cached in Varnish with tags, in the same way as products and categories.

Two new GraphQL queries have been created to expose this information to the frontend for the new headless implementation:

Question Image

During testing, the queries occasionally return stale information. How should this issue be resolved while preserving performance?

Explanation

A cacheable custom GraphQL query should use the @cache(cacheIdentity: "...") directive and an identity class that generates the relevant cache tags. Those tags let changes to a brand or its associated products invalidate the affected Varnish-cached responses, so subsequent requests return current data without disabling caching. Adobe Commerce documents that cacheIdentity points to the class that retrieves cache tags, while @cache(cacheable: false) is intended to disable caching rather than provide cache invalidation.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!