How does Cache Purge API works?

I forcibly cached the API endpoints that are not very dynamic on one of my sites by writing a Cache Rule. I set the Edge TTL to 2 hours and the Browser TTL to disable.

When I send the link of the endpoint I want to purge to Cache Purge, I get a successful response and when I go directly to the API endpoint, for example https://api.example.com/api/list, I can see the newly added or removed data with status code 200. When I refresh the page, it continues to fetch from the cache with code 304.

But when I try to fetch this API endpoint from another domain, for example https://example.com, I still see the old data with status code 304.

In short, when I access the endpoint directly, it is up-to-date, but when I fetch this endpoint from another domain, I see old data. Why this is happening and how can i solve this issue? 🤔
Was this page helpful?