RE: [SMARTY] Image Refreshing
| From: | Jeff Dickens | Date: | Tue, 04 Mar 2003 12:55:31 +0000 |
| Subject: | RE: [SMARTY] Image Refreshing | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8377@lists.php.net to get a copy of this message | ||
Not really a smarty question, but...
If you're generating the image or getting from a database, you might
want to manipulate the Cache-Control header. I did this in a script that
was storing small images in the database:
if ($cache == "true") {
header("Cache-Control: public, max-age=900");
}
else {
header("Cache-Control: no-store, no-cache, ".
"must-revalidate");
}
In the "content editor" app I used $cache=false, and in the page that
everyone else sees I used $cache=true. This leaves a window of 15 minutes
when a possibly stale image might be returned from a cache somewhere.
If you're just getting the image from a file the normal way, I don't know
how you can control the cache. I suppose you could tweak the web server to
send Cache-Control headers.
>-----Original Message-----
>From: Sam Saltis [mailto:sam@bharvest.com]
>Sent: Tuesday, March 04, 2003 3:37 AM
>To: smarty-general@lists.php.net
>Subject: [SMARTY] Image Refreshing
>
>
>All,
>
>I am replacing an existing image "image1.jpg" with another image of the
>same name and type and displaying the page again. I am not seeing the
>updated image until I manually refresh the page? When the image upload
>has a different type or name it works fine? Do I need something in my
>HTML page to get it to refresh? Or am I doing something else wrong?
>
>Cheers,
>Sam
>
>