-
PHP No-Cache
I seem to be the only guy that can't stop my PHP files caching ... so I thought someone might help me out ...
My Flash Movie submits a sendAndLoad to my php file ... the file collects data from a mysql database ... and the results are sent back to flash using the echo command in php. This all works fine right now.
When i put the PHP headers in to try and stop the php file caching the results are no longer being received.
The headers i am using are below:
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
Thanks in advance.
Trying deperately to understand
actionscript
-
Hi,
have you tried to access the php file in browser to see whether you actually get a response?
Musicman
-
Hi Musicman,
I have copied the file from the cahce and edited it ... it is not the PHP source but the returned mysql results being echoed back to flash.
Thanks
Trying deperately to understand
actionscript
-
FK'n_dog
you could add a unique number to force the server to send fresh data -
verDate = new Date();
verTime = verDate.getTime();
path = "test.php?vers="+verTime;
use 'path' in your sendAndLoad
-
that will make sure that the latest results will be in the cached file ... my problem is that I don't want the file to be cached at all.
Trying deperately to understand
actionscript
-
I have done more testing ... turns out that the header works fine on my php file and does not cache if I call it independently ... however if I call it from flash then it gets cached.
Trying deperately to understand
actionscript
-
It seems that the only command which stops the results apperaing in the php filename in the cache is: header("Pragma: no-cache") ... this is also the one that stops the results being fed back into flash after my sendandload command.
Trying deperately to understand
actionscript
-
Hi,
I am very sure this has worked for me ....
Musicman
-
Just add "?27662382" to the end of the file you want to be called. Eg:
"www.flashkit.com/mysite.php?736262" That prevents the site from being cached.
-
Thanks Silvervenom ... I think I have found the problem, it seems to center around how that works differently on secure connections ... I have been able to stop the .php files caching now and I'm just trying to sort out the jpeg and swf files now as some do not cache but others do.
Thanks for the reply.
Trying deperately to understand
actionscript
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|