Live data from Hacker News

HTML-only conditional lazy loading (via preload and media)

orga.cat

21–23 of 23 posts

Re: HTML-only conditional lazy loading (via preload and media)

#21
post #6

Earlier quoted context omitted.

I could not find this hack documented or discussed anywhere, that's what I meant.

It’s not a hack, but you may find more documentation for the equivalent preload values expressed as a tag. There is (near) parity between that and the HTTP Link header. The values used in the article should work in HTML as well.

> It’s not a hack

Yeah, this isn't a hack; this is what media queries were made for.

Now, this is a hack!

You had to do this to make :hover work correctly for IE6—IE8 [1]:

    body {
      behavior: url("csshover3.htc");
    }
[1]: https://pawelgrzybek.com/internet-explorer-just-hit-the-end-...

Re: HTML-only conditional lazy loading (via preload and media)

#22
post #18
post #17

I dont think this works. I just tested on Chrome Android via remote inspect using developer tools. It loaded the image even when the image was below the fold.

likewise - it always loads the image up front.

Are you sure? I can see the image loading much later on mobile: https://pagegym.com/compare/uu5641qndi/4d3ifzdbxk

Re: HTML-only conditional lazy loading (via preload and media)

#23

Earlier quoted context omitted.

It’s not a hack, but you may find more documentation for the equivalent preload values expressed as a tag. There is (near) parity between that and the HTTP Link header. The values used in the article should work in HTML as well.

> It’s not a hack Yeah, this isn't a hack; this is what media queries were made for. Now, this is a hack! You had to do this to make :hover work correctly for IE6—IE8 [1]: body { behavior: url("csshover3.htc"); } [1]: https://pawelgrzybek.com/internet-explorer-just-hit-the-end-...

I agree, this was not a hack. It is combined behavior from documented features (preload with media and lazy loading).
Post reply on HN