473,396 Members | 2,013 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,396 software developers and data experts.

forcing image refresh in Mozilla firefox

I have a site made entirely with AJAX, base PhP and MySQL, so the is only one page (index.php).
The user goes through various selections and an image is formed (on the server), then sent back to the client to show the updated image (SAME IMAGE NAME)
It did not work "all the time" (IE7).
I realised that the first image was stored in the cache and that, when the new image came, the image displayed was the one from the user's CACHE!
Easy enough:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     header("Cache-Control: no-cache, must-revalidate");
  3.     header("Expires: Fri, 14 Sep 2007 05:00:00 GMT");
  4. before the headers did the trick... for IE7 and others, but NOT for firefox.
  5. I tried all sorts of combinations:
  6. //    session_cache_limiter( 'nocache' );
  7. //    session_start( );
  8. or
  9. //header("ETag: PUB" . time());
  10. //header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()-10) . " GMT");
  11. //header("Expires: " . gmdate("D, d M Y H:i:s", time() + 5) . " GMT");
  12. //header("Pragma: no-cache");
  13. //header("Cache-Control: max-age=0, s-maxage=0, no-cache, must-revalidate");
  14. //session_cache_limiter("nocache");
  15.  
Any idea what would work (IE6, 7, FF, Moz, Opera)?
Sep 16 '07 #1
2 2124
ak1dnar
1,584 Expert 1GB
Shall we try to send some unique request from the client also.
Expand|Select|Wrap|Line Numbers
  1. var url="server_page.php?foo="+foo;
  2. url=url+"&bar="+Math.random();
Sep 16 '07 #2
pbmods
5,821 Expert 4TB
Heya, Jean. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=php]
PHP code goes here.
[/CODE]
Sep 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: William Park | last post by:
(Cross-posted because I use Mozilla Firefox, but I think it's also CSS issue.) Usually when I move mouse over a link, the URL is displayed at the bottom on "status line". On some website,...
15
by: Applebrown | last post by:
I've got a couple of errors on my site that I'm not sure how to fix. I'm using simple CSS for both text rollovers and my horizontal navbar, and here's what happens. First, the site: ...
1
by: nick | last post by:
In the following link, the screen has a lot of refresh when the mouse hover around the popup menu. But IE doesn't have the problem. ...
3
by: Csaba Gabor | last post by:
Not sure of best place for this question... Are there any built in images within the browser that I can assume (particularly IE and FF)? More specifically, I am writing a one file webApp.php...
7
by: Jake Barnes | last post by:
I've a little webcam program that snaps a picture of me and uploads it every 20 seconds. It automatically uploads the image to my server. It always give the image the same name, and thus it...
7
by: David Thielen | last post by:
Hi; Is there a way to embed images in the response rather than writing them to disk and having an <img ...> tag? And if so, how is it done and what browsers support it? -- thanks - dave
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
1
by: Xah Lee | last post by:
i have a problem i think only happens with OS X's Camino browser. (which is based on FireFox engine, but Fire Fox on OS X doesn't have this problem.) Basically, my website has javascript code...
3
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.