Closed Bug 304574 Opened 19 years ago Closed 18 years ago

CGI/dynamically-generated images are loaded twice when generating preview for URL bar favicon

Categories

(Firefox :: Tabbed Browser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: debuggered, Assigned: csthomas)

References

()

Details

(Keywords: fixed1.8.1, perf)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050813 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050813 Firefox/1.0+

Firefox appears to re-request a dynamically-generated image to render the
preview favicon in the URL bar if the tab bar is present. While the tab's
preview favicon matches the content, an additional request is made to generate
the preview in the URL bar, the result of which will not necessarily match the
content being viewed.

Reproducible: Always

Steps to Reproduce:
1. Start Firefox with only one start page (no extra tabs, as in a fresh profile)
2. Visit http://unbuffered.info/count.php and reload a few times. Note that the
counter increments only once per reload and that the URL bar's icon matches the
content.
3. Create a new tab to get the tab bar to appear.
4. Switch back to the first tab and reload a few times. Note that the URL bar no
longer matches the content or the tab's preview icon, and that the counter is
now increments by 2 after each reload.

Actual Results:  
Preview in URL bar is not of the same image as the one displayed, server
receives two requests.

Expected Results:  
URL bar preview icon should match the tab's preview icon, without generating an
extra request.

The PHP script records a separate count per IP.
To reset to zero, use: http://unbuffered.info/count.php?reset
To get the current value without incrementing the counter, use:
http://unbuffered.info/count.php?noinc
Version: unspecified → Trunk
Confirming on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1)
Gecko/20050813 Firefox/1.0+ ID:2005081307

Watching a http trace shows firefox sending two requests on every reload. The
image is set to not be cached.

Interestingly if you open the page in a background tab the image is only
requested once, then the url bar icon is correct when you switch to the tab with
no extra request.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This little php file reproduces the same bug with the html <img> tag.

when using <img src=""> as a temporary source for an image in website
development, the page is loaded twice (as the counter shows), which is
particularly annoying when using session variable increments.
Keywords: perf
Flags: blocking1.8rc1?
What do IE and Opera ?
not going to block on something this minor this late in the game.
Flags: blocking1.8rc1? → blocking1.8rc1-
*** Bug 325751 has been marked as a duplicate of this bug. ***
*** Bug 327216 has been marked as a duplicate of this bug. ***
*** Bug 331126 has been marked as a duplicate of this bug. ***
*** Bug 342353 has been marked as a duplicate of this bug. ***
Blocks: 125998
Odd, since I thought that was what validate="never" was for...
Could the approach proposed in bug 305986 address this problem (drawing the image to canvas and resizing there to generate a favicon)?
I don't build or use Firefox, so I can't easily test this.
Assignee: nobody → cst
Status: NEW → ASSIGNED
Attachment #226741 - Flags: review?(mconnor)
I doubt this is fallout from bug 125998.
*** Bug 338533 has been marked as a duplicate of this bug. ***
*** Bug 338176 has been marked as a duplicate of this bug. ***
*** Bug 345431 has been marked as a duplicate of this bug. ***
Whiteboard: [cst: r?]
Attachment #226741 - Flags: review?(mconnor) → review+
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [cst: r?] → [cst: a?]
Comment on attachment 226741 [details] [diff] [review]
likely patch, restore validate="never"

a=mconnor on behalf of drivers for 1.8 branch checkin
Attachment #226741 - Flags: approval1.8.1? → approval1.8.1+
Fixed on branch
Keywords: fixed1.8.1
Whiteboard: [cst: a?]
Testing in 1.5 and 1.5.01, I've found this fixed when I add a Last-Modified header to the response that was earlier than client time. That is, difference in server and client clock causing last-modified to be a few seconds in the future also got double loading.
--rrb
(In reply to comment #20)
>Testing in 1.5 and 1.5.01, I've found this fixed when I add a Last-Modified
>header to the response that was earlier than client time. That is, difference
>in server and client clock causing last-modified to be a few seconds in the
>future also got double loading.
I always thought you're supposed to use a Date header to avoid that time issue.
*** Bug 353047 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: