You need to set the http headers, of the text file generated by your script, to prevent it being cached by the browser (and by proxy servers).

The HTML META HTTP-EQUIV tags mentioned by footpad won't work, because, well, it's not html.

Now the headers you want are, afair:

Pragma: no-cache, must-revalidate Cache-Control: no-cache Expires: 0
(You can check these atRFC 2616 - this is the authoritative source for information about the HTTP protocol).

Have a look here to find out how to output those headers.

You should bear in mind that the settings in the user's browser can (unfortunately) override these headers, so this method isn't *totally* reliable. What should be totally realiable, though, is to append something different to the GET part of the request, e.g. ?r=date_in_seconds_or_something, as you mention. (Of course, this will have to happen *in Flash*). If you're doing this and it doesn't seem to be working, I suggest you have another look at your Flash.

Something to watch out for: Flash 4 has this nasty habit (don't know whether they've fixed it in version 5). If you tell it to 'load variables' from a textfile, then it *doesn't wait for the textfile to be loaded*. Solution: append an extra variable called varsloaded, in the textfile, e.g. varsloaded=Y Then, in Flash, in the frame following the 'load variables', make the movie wait until varsloaded does equal Y. (You might want to include a timeout, so that if the user's internet connection is down, then the Flash doesn't just wait forever).

HTH - andy.


In reply to Preventing caching using http headers (Re: Should I be looking at cookies?) by andye
in thread Should I be looking at cookies? by jerrygarciuh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.