/    Sign up×
Community /Pin to ProfileBookmark

Bypass cache for images?

I would like to display a gif image within a page that will change frequently (approx every 60 seconds). Is it possible to code a html parameter so that the user will always download the latest version of the graphic and not just see the one that is stored in their cache?

to post a comment
HTML

8 Comments(s)

Copy linkTweet thisAlerts:
@ray326Feb 05.2006 — The most robust way to do it would be from the server. You'd send the image with a header that indicates it's already expired.
Copy linkTweet thisAlerts:
@Old-FriendauthorFeb 05.2006 — Sorry if I'm a bit thick, but how would I do that?
Copy linkTweet thisAlerts:
@ray326Feb 06.2006 — Question #1 would be, do you have any server side programming capability?
Copy linkTweet thisAlerts:
@Old-FriendauthorFeb 06.2006 — The page is delivered by a PHP program. So in that sense it is server side program. But this server side program is just producing HTML to load the graphic.

ie;

[code=php]
<?php
....... code here ......

echo '<img src="http://www.xxxxx.com/images/xxxxxxx.gif" alt="Latest Data" />'

....... code here ......
?>
[/code]
Copy linkTweet thisAlerts:
@ray326Feb 07.2006 — <img src="showimg.php" alt="Latest Data" />

Then the showimg.php would run the full HTTP protocol to deliver the image, including sending the content-type and expiration headers.
Copy linkTweet thisAlerts:
@Old-FriendauthorFeb 07.2006 — OK. Then what can I add to the php program that would indicate that the gif file expires?
Copy linkTweet thisAlerts:
@ray326Feb 08.2006 — PHP has a function to send HTTP headers but I'm not a PHPer so I'll recommend you ask in that forum.
Copy linkTweet thisAlerts:
@Old-FriendauthorFeb 08.2006 — [URL=http://www.webdeveloper.com/forum/showthread.php?p=509635#post509635]OK thanks. Question asked here[/URL]
×

Success!

Help @Old-Friend spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...