Prompt
I keep getting stale data from public APIs
Latest observation
Oct 8, 2026
OpenAI APIWeb search: off
That usually happens because of one of these:
- Caching by the API provider: the public API may not return the newest data immediately.
- HTTP/CDN/browser caching: your client, proxy, or CDN may be serving an old response.
- Rate limiting / replicas: you may be hitting different backend nodes with inconsistent update timing.
- Eventual consistency: the API updates behind the scenes and data lags for a short time.
- Your request is cached by default: especially with GET requests.
Things to try:
-
Check response headers Look for:
Cache-ControlExpiresETagLast-ModifiedAgeCF-Cache-Status/X-Cache
-
Disable caching on your side Add request headers like:
Cache-Control: no-cachePragma: no-cache
-
Use cache-busting query params Example:
https://api.example.com/data?ts=1699999999
-
Use conditional requests carefully If the API supports
ETag, make sure you’re not unintentionally reusing cached content. -
Confirm with another client Test the same endpoint in:
- curl
- browser incognito
- Postman
- a different network
-
See if the API has freshness docs Some public APIs explicitly say data updates every X minutes/hours.
If you want, paste:
- the API endpoint,
- your request code,
- and the response headers,
and I can help figure out whether it’s provider caching or your client caching.
Brands