iTunes lookup endpoint caching - old results

I just encountered a problem, that my app was released to the App Store, the update was already visible in the App Store, but the request to https://itunes.apple.com/lookup?bundleId=***&country=*** was still returning previous app version information.

After checking the server response, I realized that one of the response headers shows that the response is cached on the Apple server and that's the reason.

X-Cache: TCP_MEM_HIT from a104-85-249-20.deploy.akamaitechnologies.com (AkamaiGHost/11.1.3-49328623) (-)
Cache-Control: max-age=12989

.

The question is:

Can I safely use cache-busting solution to always get the latest results?

It could be done like: https://itunes.apple.com/lookup?bundleId=***&country=***&t=<current_timestamp>

I tested it and it works with the random timestamp, I always get not cached results.

Post not yet marked as solved Up vote post of gffgbbg Down vote post of gffgbbg
558 views
  • To add some information, setting URLRequest's cachePolicy to reloadIgnoringLocalAndRemoteCacheData does not invalidate the cache. Therefore, I ended up using the cache-busting method.

Add a Comment