Current time: 12-13-2017, 09:38 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP2 PUSH media queries not working
06-08-2017, 08:59 PM
Post: #1
HTTP2 PUSH media queries not working
when I use the HTTP Link header, e.g. as seen here: https://phabricator.wikimedia.org/phame/...rce_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.
Find all posts by this user
Quote this message in a reply
06-08-2017, 09:41 PM
Post: #2
RE: HTTP2 PUSH media queries not working
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-08-2017, 11:26 PM
Post: #3
RE: HTTP2 PUSH media queries not working
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/...oad_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?
Find all posts by this user
Quote this message in a reply
06-13-2017, 09:23 PM
Post: #4
RE: HTTP2 PUSH media queries not working
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)