473,473 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Forced Image Refresh

I have a web site that allows users to upload images. The problem is when
an image is uploaded over the top of another image the user would have to
press F5 to refresh the images and clear the cashe. Is there anyway I can
automatically make the image refresh?

If that is not possible is there a way of making the whole page refresh
automatically?
Nov 18 '05 #1
3 1589
Paul Johnson wrote:
I have a web site that allows users to upload images. The problem is when
an image is uploaded over the top of another image the user would have to
press F5 to refresh the images and clear the cashe. Is there anyway I can
automatically make the image refresh?

If that is not possible is there a way of making the whole page refresh
automatically?


I always add a querystring arg to the image tag's src that is
time-dependent. For example, the UTC time on the server, which would
look something like this

http://mysite.com/image.aspx?uid=99123833 OR
http://mysite.com/image.gif?uid=99123833

that way the url that is given to the browser is always unique and
forces a new request to download it again.

Learned that from the old IE5 days, when that browser cached everything
it could and wouldn't react to HTTP expiration headers (or at least it
seemed it was way too difficult to figure out how to get things not to
cache).....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #2
Ah this works great thanks. So simple as well :)
"Craig Deelsnyder" <cdeelsny@SPAM_BE_GONEyahoo.com> wrote in message
news:OJ**************@TK2MSFTNGP12.phx.gbl...
Paul Johnson wrote:
I have a web site that allows users to upload images. The problem is when an image is uploaded over the top of another image the user would have to press F5 to refresh the images and clear the cashe. Is there anyway I can automatically make the image refresh?

If that is not possible is there a way of making the whole page refresh
automatically?


I always add a querystring arg to the image tag's src that is
time-dependent. For example, the UTC time on the server, which would
look something like this

http://mysite.com/image.aspx?uid=99123833 OR
http://mysite.com/image.gif?uid=99123833

that way the url that is given to the browser is always unique and
forces a new request to download it again.

Learned that from the old IE5 days, when that browser cached everything
it could and wouldn't react to HTTP expiration headers (or at least it
seemed it was way too difficult to figure out how to get things not to
cache).....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 18 '05 #3
Ah this works great thanks. So simple as well :)
"Craig Deelsnyder" <cdeelsny@SPAM_BE_GONEyahoo.com> wrote in message
news:OJ**************@TK2MSFTNGP12.phx.gbl...
Paul Johnson wrote:
I have a web site that allows users to upload images. The problem is when an image is uploaded over the top of another image the user would have to press F5 to refresh the images and clear the cashe. Is there anyway I can automatically make the image refresh?

If that is not possible is there a way of making the whole page refresh
automatically?


I always add a querystring arg to the image tag's src that is
time-dependent. For example, the UTC time on the server, which would
look something like this

http://mysite.com/image.aspx?uid=99123833 OR
http://mysite.com/image.gif?uid=99123833

that way the url that is given to the browser is always unique and
forces a new request to download it again.

Learned that from the old IE5 days, when that browser cached everything
it could and wouldn't react to HTTP expiration headers (or at least it
seemed it was way too difficult to figure out how to get things not to
cache).....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Arnold | last post by:
Hey there, I've browsed for some fixes to this but only found a couple of similar posts, which didn't solve my problem. I'm wondering how to refresh an image control in a form after a user...
2
by: Mark Essex | last post by:
I am trying to build an interface that requires the developer to use the OVERRIDE option. I looked at abstract classes, but seemed to have a couple of problems: 1. If you do this in a form, it...
1
by: Marco Maroni | last post by:
How to force image refresh on client browser ? Is ti possible to force the refresh of the same image (tha was changed server-side) to the client, without user press Contrl+F5 in IE ? - Marco
11
by: Jerry J | last post by:
How can I get an asp:Image to refresh when a user uploads a different jpg. I disabled caching using this command on Page_Load(): Response.Cache.SetCacheability(HttpCacheability.No Cache); but it...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.