Creating several Image() objects with the same src loads the URL once
Reported by
johan.sa...@dailymotion.com,
Feb 27 2017
|
||||
Issue descriptionUserAgent: 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.
,
Feb 27 2017
,
Feb 27 2017
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)
,
Feb 27 2017
,
Feb 28 2017
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? |
||||
►
Sign in to add a comment |
||||
Comment 1 by woxxom@gmail.com
, Feb 27 2017