Strange Ajax Caching Problem?

Get help using Construct 2

Post » Thu Aug 30, 2012 4:44 pm


I'm new to Construct2 and this is my first post so please be kind ;)

I'm trying to make an asyncronous mulitplayer card game.

As a first step I followed this great tutorial:

I then altered it to produce a simple multiplayer chat engine. It all worked perfectly at first, but then it started taking several minutes for changes in the database to be reflected on my screen (though it seemed to be working fine for other people).

If I just run my getmessages.php it works fine, and sendmessages.php works too. I'm pretty sure that the issue is that the data in Ajax.LastData is stale - somehow it seems to be cached even if I quit the page and then reload it. Is this possible?

One other (possibly related) issue. Whenever I goto the page on a new machine it asks if it can store offline data on the local machine. Is this normal, and how can I stop it?

Thanks for your help!

EDIT: The data was still stale when I loaded the page in a different browser, which seems even more crazy...
Steerpike2012-08-30 16:51:17
Posts: 13
Reputation: 443

Post » Thu Aug 30, 2012 6:30 pm

In case anyone else is suffering from similar problems, I've found a hacky workaround:

I've changed the URL of the Ajax request from "http://MYDOMAIN.COM/getmessages.php" to "http://MYDOMAIN.COM/getmessages.php?randNum=" &tickcount - adding this radom(ish) number on the end seems to persuade Ajax that this is a genuine new request

I'd still like to know the proper answers to my questions though if anyone knows them ;)
Posts: 13
Reputation: 443

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests