Firefox does not display updated image on first reload

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

Post Posted October 31st, 2014, 3:18 am

Test on Apache 2.2 on Windows 7 (x64). Firefox 32.0.3.
Code: Select all
<!doctype html>
         <link rel="stylesheet" type="text/css" href="test.css">
         <div style="background-image: url('images/direct.png'); height: 60px;">
               <h1>Background image loaded via style attribute!</h1>
         <div class="background-div">
               <h1>Background image loaded via CSS!</h1>

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"

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
Posts: 117342
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted October 31st, 2014, 5:27 am

Moving to Web Development.

Posts: 2
Joined: October 31st, 2014, 3:07 am

Post Posted October 31st, 2014, 10:45 am

I've hosted a page at ... /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
Posts: 10077
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted November 14th, 2014, 5:24 pm

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?

New Member
Posts: 1
Joined: November 5th, 2015, 3:43 pm

Post Posted November 5th, 2015, 4:24 pm

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.

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
Posts: 27001
Joined: June 18th, 2003, 3:07 pm
Location: Made in Canada

Post Posted November 6th, 2015, 1:14 am

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

Return to Web Development / Standards Evangelism

Who is online

Users browsing this forum: No registered users and 1 guest