Topic: Disabling Cache (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: |
posted 12-09-2008 17:50
Is it possible to disable the caching of a certain webpage. I have an image that is pulled from the server that displays a unique PIN that my customers are required to write down. The only problem I have is that this image is cached so when they purchase a second product after some time the same image is displayed and not a new one. Does anyone have any suggestions for this problem? |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 12-10-2008 09:16
Yes. Send the appropriate headers. that basically 'don't cache, must refresh every time, expired three weeks ago'. |
Nervous Wreck (II) Inmate From: |
posted 12-10-2008 19:01
I used the following code, but in OSCommerce I receive the error: quote:
quote:
code: <?php print "<img src='yourfile.jpg?".time()."'>"; ?>
|
Paranoid (IV) Inmate From: cell 3736 |
posted 12-10-2008 20:41
The header() functions must be the absolute first thing in the file (before includes etc) or otherwise they may not work and this also means that they can't be in one of the included files at least this is the safest way to go about it. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 12-11-2008 10:57
quote:
|
Nervous Wreck (II) Inmate From: |
posted 12-11-2008 15:53
quote:
|
Nervous Wreck (II) Inmate From: |
posted 02-07-2009 21:07
I know that it has been a while since I have visited this thread, but this problem still exists for me. I went about trying to set a no-cache just on the image, but this didn't work either: code: <img src="myimage.png?<?php echo filemtime('myimage.png') ?>">
|