Last modified: 2014-07-01 13:00:24 UTC
After having already loaded the full screen viewer (not the HTML 5 OS-level full screen, but just page filling overlay), shrinking the browser window fires off 4 http requests. Say the current window size requested 1280px width and I narrow the window to about 800px wide * Current image at 1024px (XHR) * Current image at 1024px (Image) * Some image I previously viewed at 1024px (XHR) * Some image I previously viewed at 1024px (Image) Imho shrinking the window shouldn't fire off any http requests. The browser is good enough at scaling (especially with HiDPI in mind). Certainly not worth it when just adjusting the screen a little. But either way, if you really want to, just fetch one :) Steps: 0. In Chrome (35; stable), 1440x900px Retina display, browser window maximised. 1. Open https://commons.wikimedia.org/wiki/Category:Carla_Bruni 2. Click "Nicolas Sarkozy and Carla (..) Obama.jpg". 3. Close it, and click "Michelle (..) G20 leaders tour.jpg". 4. Open Dev Tools (pop out), focus Network, clear current log. 5. Resize window to about half the width Expected: No network activity Actual: 1) 1280px-Michelle_Obama_and_the_spouses_of_the_G20_leaders.jpg upload.wikimedia.org/wikipedia/commons GET 200 image/jpeg 185 KB 63 ms OK XHR 185 KB 16 ms Request: - Accept:*/* - Cookie: Response: - Age:14399 2) 1280px-Michelle_Obama_and_the_spouses_of_the_G20_leaders.jpg upload.wikimedia.org/wikipedia/commons GET 200 image/jpeg 185 KB 61 ms OK Images 185 KB 11 ms Request: - Accept:image/webp,*/*;q=0.8 - Cookie:GeoIP=*******::*******:v4 Response: - Age:14400 3) 1280px-Nicolas_Sarkozy_and_Carla_Bruni_welcomes_by_Michelle_and_Barack_Obama.jpg upload.wikimedia.org/wikipedia/commons GET 200 image/jpeg 191 KB 56 ms OK XHR 191 KB 14 ms Request: - Accept:*/* - Cookie: Response: - Age:13063 4) 1280px-Nicolas_Sarkozy_and_Carla_Bruni_welcomes_by_Michelle_and_Barack_Obama.jpg upload.wikimedia.org/wikipedia/commons GET 200 image/jpeg 191 KB 40 ms OK Images 191 KB 11 ms Request: - Accept:image/webp,*/*;q=0.8 - Cookie:GeoIP=*******::*******:v4 Response: - Age:13063
Sometimes I actually get 6, not 4. If I made the window larger anywhere in between, it will re-request the old image at the large size first as well. Which requests: 1) 1920px- image prev (XHR) 2) 1920px- image prev (Image) 3) 1280px- image curr (XHR) 4) 1280px- image curr (Image) 5) 1280px- image prev (XHR) 6) 1280px- image prev (Image)