WebPagetest Forums
HTTP2 PUSH media queries not working - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: HTTP2 PUSH media queries not working (/showthread.php?tid=14930)



HTTP2 PUSH media queries not working - DuckDagobert - 06-08-2017 08:59 PM

when I use the HTTP Link header, e.g. as seen here: https://phabricator.wikimedia.org/phame/live/7/post/19/improving_time-to-logo_performance_with_preload_resource_hints/

Link: </static/images/project-logos/enwiki.png>;rel=preload;as=image;media=not all and (min-resolution:1.5dppx),</static/images/project-logos/enwiki-1.5x.png>;rel=preload;as=image;media=(min-resolution:1.5dppx) and (max-resolution:1.999999dppx),</static/images/project-logos/enwiki-2x.png>;rel=preload;as=image;media=(min-resolution:2dppx)


Webpagetest.org will HTTP Push ALL files, not only those that would apply.
When testing it in Chrome on my laptop, it works fine however.


RE: HTTP2 PUSH media queries not working - pmeenan - 06-08-2017 09:41 PM

Dev tools is probably only showing you the pushed resources that the browser actually claimed. It doesn't have any visibility into the pushed resources that are abandoned (those are held deep in the net stack). If you capture a netlog (about://net-internals) on your dev box you will see the pushed resources that aren't claimed.

Preload knows how to do media queries but push doesn't since push is initiated by the server.


RE: HTTP2 PUSH media queries not working - DuckDagobert - 06-08-2017 11:26 PM

thanks for the quicky reply

isn't that the same.
preload via link HTTP header is PUSH, isn't it?

on the link provided from wikimedia (https://phabricator.wikimedia.org/phame/live/7/post/19/improving_time-to-logo_performance_with_preload_links/) they put a link rel="preload" header with a media query - which as far as I understand (& what webpagetest.org says when checking) is PUSH?


RE: HTTP2 PUSH media queries not working - datadiggers - 06-13-2017 09:23 PM

Chrome dev tools seems to by default hide unused resources pushed by server.

You can't use media queries on HTTP2 push, at least not the way you think. The server/CDN has no idea what resolution the user has so it pushes all content. User browser may decide to cancel transfer of some pushed content but unless you're pushing a lot of data (big file(s) or a lot of files) it won't improve performance as by the time server receives the cancel notification from user browser the data will be already pushed through pipe. Plus I'm not sure if any browser actually does such optimization.

Oh, and preload is not the same as HTTP2 push.