New issue
Advanced search Search tips

Issue 696469 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Creating several Image() objects with the same src loads the URL once

Reported by johan.sa...@dailymotion.com, Feb 27 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Create a new Image()
2. Subscribe to its "onload" and "onerror" events
3. Set its src property
4. When one of the events has been triggered, wait a few seconds, go back to step 1, repeat several times (with the same URL)

What is the expected behavior?
* The image should appear several times in the Network panel
* The "onload/onerror" event should have been triggered several times

What went wrong?
* The image appears only once in the Network panel
* The "onload/onerror" event is triggered correctly, every time

Did this work before? N/A 

Chrome version: 56.0.2924.87  Channel: stable
OS Version: OS X 10.12.0
Flash Version: 

Complete test case + screen capture attached to the ticket.

 
load_image.html
1010 bytes View Download
load_image.png
161 KB View Download

Comment 1 by woxxom@gmail.com, Feb 27 2017

Beware the testcase html should be loaded from a local http server, not directly from a disk folder, or edited manually in a text editor to set the protocol explicitly: var url = 'http://ads.stickyadstv.com/auto-user-sync'
Components: -Blink Blink>Network
Cc: hirosh...@chromium.org dgozman@chromium.org
Components: -Blink>Network Platform>DevTools Blink>Loader
Labels: -OS-Mac OS-All
Status: Untriaged (was: Unconfirmed)
How current implementation works:
In this case the images are served from/merged by MemoryCache, and currently requests merged by MemoryCache are not shown in DevTools (except for its first request).
This is similar to situations where a document contains multiple <img> elements with the same URL and then DevTools shows only one request.
If the cached response expires (e.g. due to Cache-Control header), then there should be a request going to the network and shown in DevTools.
Does this make sense for you?
(I'm not so sure when DevTools should or should not show requests served by MemoryCache; adding DevTools tag)

Status: WontFix (was: Untriaged)
Thanks for your answers.

Actually, the problem can also be reproduced when setting a no-cache HTTP header on the served image.

In that case, shouldn't we see a new request for each Image() created?
no_cache_image.php
136 bytes View Download

Sign in to add a comment