Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Generated file
- Andrew Clark
November 27, 2005, 6:36 pm
rate this thread
I am 99% sure that the problem I am having is not PHP related, but to
remove my doubt, I am posting here.
I have a search page (interfacing with MySql) that displays results in an
IFRAME on the search page. I did this so the whole page would not have to
be reloaded on each query.
Each time I query the DB, I write the result set to a file and include this
works fine, which is why I say I don't think this is PHP related.
first query recordset is all that is ever seen by the search page, even
little opaque so I will give an example.
<IFRAME NAME="dataiframe" SRC="blank.html"></IFRAME>
<FORM ACTION="display.php" METHOD="post" TARGET="dataiframe">
$filename = "tmp/" . session_id () . ".js";
// write recordset...
// include here
This file is always generated correctly. The problem arises when the
browser (IE) does not use the updated values in $filename. It is my belief
that IE caches the values in this file and when the frame is reloaded, IE
tries to be "smart" and sees that I am including the same file, and
therefore does not reload from the file but from its cache.
Now that I think about it, since the file is being correctly generated,
this is 100% NOT PHP related. Could someone shed light on this anyway? It
would be much appreciated.
- Alvaro G. Vicario
November 27, 2005, 7:27 pm
Re: Generated file
I don't whether IE obeys date headers but you can tag the script document so it expires inmediately:
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
header('Expires: ' . gmdate('D, d M Y H:i:s', time()-86400*365*10) . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
BTW, have you remembered to set the appropriate Content-Type header?
-+ Álvaro G. Vicario - Burgos, Spain
++ http://bits.demogracia.com es mi sitio para programadores web
+- http://www.demogracia.com es mi web de humor libre de cloro
Re: Generated file
comments at http://php.net/imagecreatefrompng.
Another technique some people use (which I don't recommend for
production, but may be OK for testing) is to append a dummy query
string to the end of the main page with a random component: "?rubbish="
+ randomNumber(). This ensures that the page is not cached.
Csaba Gabor from Vienna
Andrew Clark wrote: