473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Refresh Images Once

I've done hours of research but I can't seem to find an answer to a
very simple problem.

I have a catalog site where a user can upload an image for a certain
product. He/she edits the product by uploading a different image.
The problem is that the image is being cached and it doesn't get
refreshed unless a user manually refreshes his/her browser.

I've tried HTTP headers, Meta tags, htaccess and javascript. How are
you guys doing this? The text of the product (stored in a db) changes
but the image (stored in a directory) doesn't.

I've read of spoofing the url so it's different each time. I rather
not set no-cache to the entire page because it would slow down
searches. I just need the images to be refreshed.
Jul 17 '05 #1
4 2039
> I've read of spoofing the url so it's different each time. I rather
not set no-cache to the entire page because it would slow down
searches. I just need the images to be refreshed.


I can't remember where I heard this, but I seem to remember that if you add
a question mark to the end of the image source, the browser will not cache
it. ie.

<img src="item0001.jpg?" />

Can anyone else verify this?

Chris Finke
Jul 17 '05 #2
Nel
"Christopher Finke" <ch***@efinke.com> wrote in message
news:2l************@uni-berlin.de...
I've read of spoofing the url so it's different each time. I rather
not set no-cache to the entire page because it would slow down
searches. I just need the images to be refreshed.
I can't remember where I heard this, but I seem to remember that if you

add a question mark to the end of the image source, the browser will not cache
it. ie.

<img src="item0001.jpg?" />

Can anyone else verify this?

Chris Finke

I remember the same, but with a random number on the end

<img src="item0001.jpg?1234567890">

That way the browser sees a different number each time (well by law of
averages). You could use time ?hhmmss

Nel
Jul 17 '05 #3
Nel wrote:
"Christopher Finke" <ch***@efinke.com> wrote in message
news:2l************@uni-berlin.de...
I've read of spoofing the url so it's different each time. I rather
not set no-cache to the entire page because it would slow down
searches. I just need the images to be refreshed.


I can't remember where I heard this, but I seem to remember that if you


add
a question mark to the end of the image source, the browser will not cache
it. ie.

<img src="item0001.jpg?" />

Can anyone else verify this?

Chris Finke


I remember the same, but with a random number on the end

<img src="item0001.jpg?1234567890">

That way the browser sees a different number each time (well by law of
averages). You could use time ?hhmmss

Nel

Better yet, with the webcam thing I made once, I used the time() to
create a number. That way it's different every time..
Jul 17 '05 #4
Thanks guys. Adding '?'.time() did the trick.
Jul 17 '05 #5

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

Similar topics

10
by: Conax | last post by:
Hi there, My boss is hoping that I can come up with a page that displays some information. The information will always be displayed on specific part of the page, with auto refresh. But he...
3
by: John Ramsden | last post by:
In a monitoring app I have written, the message summary screen refreshes itself automatically every couple of minutes via the line <meta http-equiv="Refresh" content="180">. The screen mostly...
1
by: Luna Kwok | last post by:
Hello, I have a very strange problem. When I load up a page, all the images look fine, but when I refresh the page, all the images become dead. This happens on both IE and netscape. I have...
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...
5
by: Selden McCabe | last post by:
I have a page that displays a picture. In the page load I figure out which image and then do a StudentPicutre.imageurl = <some file name> But if you use the browser's back button, enter...
0
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in...
3
by: autospanker | last post by:
Ladies and Gentleman, I have been having this problem that has been driving me insane. I have a website that when viewed in Firefox first, the content in the body area is pushed down. Then when...
5
by: Kaante | last post by:
Hi, I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website. I want to have a message icon on the top frame which would flash once the...
35
by: Kaante | last post by:
Hi, i want a frame on my website to display one pic if the user has new messages and another different pic if it dsnt. Before i used html to auto refresh page every 10 secs. that was annoying...
32
by: C. (http://symcbean.blogspot.com/) | last post by:
Hi all, I have an application which generates image graphs. These cache nicely at the client, however if the user submits more data, I'd like to force a reload of the image from the server. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.