Strange Ajax Caching Problem?

0 favourites
  • 2 posts
From the Asset Store
Strange factory themed set of tiles for your platformer game
  • Hi,

    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:

    scirra.com/tutorials/346/online-high-score-table-ajax-php-mysql/page-1

    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...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)