Victoria
Victoria

Reputation: 11

Flash caches a JSON response when we never want it to

We have a game built in Actionscript 3, but for some users when they load the game it's loading the cached version of their saved game (JSON string) instead of getting the latest one from the server. We've implemented a random string at the end of the request URL, and I've also added headers for pragma and cache-control to the request. I'm not sure if adding those headers will make a difference though.

Is there anything else we can do to fix this? Will adding those headers help? Is there any documentation about how different browsers would handle this?

It's not a problem we can test so we're pretty much stabbing in the dark until users stop emailing us about it.

Thanks!

Upvotes: 1

Views: 393

Answers (2)

TheHippo
TheHippo

Reputation: 63179

Two things you could try:

  • Use POST request
  • Add a random string (unix time stamp or something similar) at the end of you URL that is totally ignored by your server: foo/bar.json?foo=bar&dc=1315486845135

Upvotes: 0

grapefrukt
grapefrukt

Reputation: 27045

Adding the random query-string has always worked for me. Perhaps you could try and use a debug proxy to see what's going on behind the scenes. I swear by Charles, but I also hear good things about Fiddler.

Upvotes: 2

Related Questions