Rest API Cache

Topic summary

  • Issue: REST API responses appear cached, returning outdated inventory quantities. The requester needs a way to fetch fresh, real-time inventory data via REST and prefers not to switch to GraphQL.

  • Attempts to bypass caching: Tried HTTP headers Cache-Control: no-cache, Pragma: no-cache, and If-None-Match with a random value. Also appended a timestamp query parameter to the URL. None of these approaches affected the response.

  • Ask: Looking for any supported method to force a fresh response or bypass server-side caching specifically for inventory via REST.

  • Status: No solution or workaround has been provided yet; the question remains open (Category: Custom Storefronts; Tags: optimization, troubleshooting).

Summarized with AI on January 18. AI used: gpt-5.

Correct me if I’m wrong but looks like the Rest API returns cached response. Is there a way to retrieve a fresh data(I need an inventory quantity) using the Rest API?

I tried adding headers like:

  • Cache-Control: no-cache
  • Pragma: no-cache
  • If-None-Match: {random_value}

Also I tried to add a timestamp as a query parameter to the request URL.

Any of those didn’t help. Any solution (except using GraphQL) would be helpful! Thanks!

2 Likes