473,809 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ 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 1606
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.co m> wrote in message
news:OJ******** ******@TK2MSFTN GP12.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.co m> wrote in message
news:OJ******** ******@TK2MSFTN GP12.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
8856
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 clicks a cmd button to open the Windows API Common Dialog and selects a new file (jpeg). Images are initially loaded in the form's oncurrent event. I've tried using me.dirty = false to make the form current. Has anyone experienced this before?
2
1331
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 appears that I can't get the designer to display the derived forms 2. It forces the override in the derived form (form A), but if another form (form B) derives from this derived form (form A), it isn't forced to override the method.
1
10862
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
5677
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 didn't help. The problem is that this page does not change images after a client uploads a new one. If I hit the browser's refresh, then I can see the updated image, but if I don't refresh, then I see the previous image.
0
9602
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10639
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
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.