My Magento 2.4 isn't caching requests I use many times, like storeConfig via PWA Studio.
My request header:
x-cache-hits: 0
How could I cache this kind of request to optimize the speed of my page loads?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThe storeConfig cache will be released in the lasted version of Magento 2.4.7, so you will be able to update it to have it.
About other requests, you need to create a Resolver, then specified it in your GraphQL schema.
@doc(description: "The store config query") @cache(cacheIdentity: "Magento\\StoreGraphQl\\Model\\Resolver\\Store\\Identity")
You can see an example of it in the Magento 2 Core storeConfig cache implementation.
Don't forget to make sure you configured the Caching with Varnish or Caching with Fastly steps too.