ArtSabintsev / Siren

Notify users when a new version of your app is available and prompt them to upgrade.
http://sabintsev.com/
MIT License
4.26k stars 407 forks source link

iOS request cache - question #413

Closed bbialas closed 1 year ago

bbialas commented 1 year ago

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=XXX&country=XXX 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

Why not to implement a cache-busting solution into this plugin, to always get the latest result from the Apple server?

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

What do you think?

PS. When I tested it with this solution, I got a good response with the latest app version data. I never had this issue before, and I wonder, if this caching is maybe something new introduced by Apple on their servers...

ArtSabintsev commented 1 year ago

Hi - feel free to open a PR

farazkhan96 commented 1 year ago

Any solution for this? same is happening for me. The app was released 2 days ago and it is still returning the older version.

ArtSabintsev commented 1 year ago

Hi, as mentioned above, I need a PR open to review this. I don't actively do iOS development anymore.

bbialas commented 1 year ago

Hello, I created a PR, please take a look.

https://github.com/ArtSabintsev/Siren/pull/415

Thank you.