The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 12 of 12

Thread: Maybe a bit offtopic...how to prevent caching of game?[*urgent]

  1. #1

    Maybe a bit offtopic...how to prevent caching of game?[*urgent]

    i have a game that is supposed to read from a text file. but it generally reads the data from last time i played it. If i clear the cache of my browser, it loads correctly. How to solve this problem??

    On a sidenote-- How do you make "subscript" text for a dynamic text?
    Last edited by bluemagica; May 23rd, 2008 at 01:23 PM.
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  2. #2
    I have seem this problem with php, what people normally do is passing a random parameter which doesn't define anything, but makes the call unique.

    I don't think this would be possible to do using text files. But, then, I think you should rethink this approach of using text files, anyway.
    Bruno Palermo
    When everything is catastrophic, thank the Gods things aren't worse!

  3. #3
    Actually my client is bent on text files... i have no alternative
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  4. #4
    http://www.kirupa.com/developer/acti...icks/cache.htm
    Or you can use this cache manager extension:
    http://www.communitymx.com/content/a....cfm?cid=827EA

    Quote Originally Posted by bluemagica View Post
    On a sidenote-- How do you make "subscript" text for a dynamic text?
    You can't easily...you will probably have to embed a subscript font:
    http://www.kirupa.com/forum/showthread.php?t=269348
    2006-11 GlosRFC - Searching 8,168,684,336 brain cells

  5. #5

    off topic:
    -------------------------

    It's worth noting that AS3 fixes this issue. URLLoader / URLRequest doesn't have the same problem. Yet another reason to switch!

    Last edited by Anogar; May 24th, 2008 at 03:44 AM.

  6. #6
    Actually his client demands he uses text... Damn clients.

    Anyway, the approach I told you before works for text too.

    Here what I could devise:
    Code:
    function cacheClean(fCall) {
        if (!_url.indexOf('file')) {
            tResult = fCall;
        } else {
            var connector:String = (fCall.indexOf('?') < 0) ? '?cachecleaner=' : '&cachecleaner=';
            tResult = fCall + connector + new Date().getTime();
        }
        return tResult;
    }
    And here is the call:
    Code:
    lVar.load(cacheClean('data.txt'));
    By the way, the "connector" bit is to allow you to use this function with other stuff in which case you may want to actually pass other parameters.
    Last edited by bpalermo; May 23rd, 2008 at 04:51 PM.
    Bruno Palermo
    When everything is catastrophic, thank the Gods things aren't worse!

  7. #7
    It's still just a flat text file, it just has some extra formatting. I'm sure he could talk a client into that - if he's good he'll make it seem like he's doing the client a favor. (Which he is.)

  8. #8
    Whether it's XML or text is immaterial - the file is still going to be locally cached unless he loads a unique version each time.
    2006-11 GlosRFC - Searching 8,168,684,336 brain cells

  9. #9
    Not if he uses the function I presented above...
    Bruno Palermo
    When everything is catastrophic, thank the Gods things aren't worse!

  10. #10
    Quote Originally Posted by bpalermo View Post
    Not if he uses the function I presented above...
    You must've missed this part of my post "unless he loads a unique version each time" which is all the function (and the links I provided) does....it forces the browser to download a unique version of the file, whether that's by appending a date, a random number, or 50 naked penguins to the end of the filename.
    2006-11 GlosRFC - Searching 8,168,684,336 brain cells

  11. #11
    I didn't. I just wanted to make sure he would get that the function worked, otherwise he might interpret your email wrongly and assume that the function didn't do what you where saying should be done.

    By the way, checked the links you posted, which I had completely missed before and would have saved me the time to come up with and test that function if I hadn't. Nice ones.

    Sorry if I stepped on a toe or something...
    Bruno Palermo
    When everything is catastrophic, thank the Gods things aren't worse!

  12. #12
    Wow thanks a lot guys! I think this is fixed now!!

    And Anogar if I used XML file, the end result would have been the same, since the problem was with caching! But thanks for trying...

    Bpalermo, thankyou for your code, it made things more clear to me, and helped me understand exactly how to fix my problem!

    glosrfc, i cant thank you enough for those links...especially the second one...

    Again, thanks for being so kind and helpful guys!
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012