Search Unity

UnityWebRequest caching issues

Discussion in 'Scripting' started by ElnuDev, Apr 27, 2020.

  1. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    I have a highscore system set up on a webserver, on which there is a PHP page that is accessed to get data from the MySQL database indirectly. For some reason,
    UnityWebRequest
    is caching the highscore data and it is showing old information, both in WebGL and in the Editor, even after restart. The only way I could fix the problem with WebGL is opening an incognito window. I tried
    www.useHttpContinue = false;
    ,
    UnityWebRequest.ClearCookieCache();
    , and even messing with the
    .htaccess
    file on my webserver, but nothing helped. I've checked in the database and the data went through properly, and it updates on the PHP page that Unity accesses properly as well. Any ideas? Thanks in advance!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    What happens if you attach a randomized argument to the URL that the PHP simply ignores?

    Code (csharp):
    1. https://www.mywebserver.com?foo=123
     
    ElnuDev likes this.
  3. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    I figured out the solution. It was just an idiocy in my coding that had nothing to do with networking at all :oops:
     
    Kurt-Dekker likes this.