Firefox does not display updated image on first reload

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Locked
5inGularity
Posts: 2
Joined: October 31st, 2014, 3:07 am

Firefox does not display updated image on first reload

Post by 5inGularity »

Test on Apache 2.2 on Windows 7 (x64). Firefox 32.0.3.
Setup
test.html

Code: Select all

<!doctype html>
<html>
   <head>
         <link rel="stylesheet" type="text/css" href="test.css">
   </head>
   <body>
         <div style="background-image: url('images/direct.png'); height: 60px;">
               <h1>Background image loaded via style attribute!</h1>
         </div>
         <div class="background-div">
               <h1>Background image loaded via CSS!</h1>
         </div>
   </body>
</html

test.css

Code: Select all

.background-div {
      background-image: url('images/css.png');
      height: 60px;
}

Put css.png and direct.png under images folder.

Configure mod_headers using following -

Code: Select all

<Location /images/>
   <IFModule mod_headers.c>
      Header set Cache-Control "no-cache, must-revalidate"
   </IFModule>
</Location>


Steps to reproduce
1. Load the page with clean cache
2. Reload the page
3. Update css.png
4. Reload the page
5. Reload the page

Expected results:
After step 4, updated image must be shown by browser.

Observed Results:
After step 4, image is not updated. After step 5, updated image is displayed.

Note that one step 2, browser sends conditional GET and receives status code 304 and does not fetch any content. On step 4 it sends conditional GET and does fetch the data, and does fetch the new content as the response code is 200. Despite having fetched the new contents it does not update the image. On step 5, conditional GET is sent and server sends status code 304 and still the browser now updates the image.
User avatar
DanRaisch
Moderator
Posts: 127240
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Firefox does not display updated image on first reload

Post by DanRaisch »

Moving to Web Development.
5inGularity
Posts: 2
Joined: October 31st, 2014, 3:07 am

Re: Firefox does not display updated image on first reload

Post by 5inGularity »

I've hosted a page at http://ec2-54-69-202-185.us-west-2.comp ... /test.html. This page has the two images linked. The image folder has two version of these images each which the html/css does not link to. I've added two php pages which switch the linked image between the two versions.

Steps to reproduce:
1. Load the page with clean cache
2. Switch the version (if current image has 1 in it, click "Change to v2" and vice-versa). Let's say initial version was 1 and you switched to v2.
3. Click browsers back button (page shows version1 - this is expected)
4. Hit refresh (page still shows version1 - this is not expected).
5. Hit refresh (version 2 of both images is shown).
User avatar
jscher2000
Posts: 11763
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Firefox does not display updated image on first reload

Post by jscher2000 »

This is strange. After #4, if I right-click the page > View Page Info > Media, or if I right-right the image > View Background Image, it shows the other image (the one that should be displayed in the page).

I think some performance optimization may have made the painter too lazy.

Have you filed a bug? https://bugzilla.mozilla.org/
rossw
New Member
Posts: 1
Joined: November 5th, 2015, 3:43 pm

Re: Firefox does not display updated image on first reload

Post by rossw »

I haven't seen any updates to or workarounds for this problem, wondering if anything is happening?

Here's another page that demonstrates the problem.
http://support.rossw.net/avmet.html

The wide photo (montage) is background, with a transparent gif overlayed.
On initial load, everything is fine.
The background image updates every 5 minutes. (Timestamp in lower-left corner of photo)

After initial load, wait at least 300 seconds.
Hit refresh, the content will update; a request is sent for the background image (which IS sent back to the browser), yet the background image continues to display as the previous image.
Hit refresh a second time, another request is sent for the background image, but this time it does display the new image.

Page validates fine, problem doesn't manifest in Safari.
User avatar
James
Moderator
Posts: 28006
Joined: June 18th, 2003, 3:07 pm
Location: Made in Canada

Re: Firefox does not display updated image on first reload

Post by James »

This thread was from a year ago. Please start a new thread instead.
Locked