Re:Entire website in a single HTML file
by johndough on Friday December 24, 2021 @01:58AM
(#29671074)
Easy solution. Use progressive compression for images and set loading="lazy" https://developer.mozilla.org/en-US/docs/Web/Performance/Laz...
[ Parent
| on HN ]
Re:Entire website in a single HTML file
by mathnmusic on Friday December 24, 2021 @02:28AM
(#29671238)
loading="lazy" is for images that are NOT embedded in the same file. So we either have entire site in a single HTML file or we have scalability for large stes. There's no solution that gives us both.
Re:Entire website in a single HTML file
by johndough on Friday December 24, 2021 @08:51AM
(#29673554)
It depends on what your goal is. If you just want to make a single request to the web server, than loading="lazy" will not work as you said. (Technically speaking, TCP is sending multiple packages anyway resulting in higher latency, so not sure if that is a great goal.)
But if you just want to be able to save the entire website with Ctrl + S, then it works fine.
As an aside, loading="lazy" is the way in which images are embedded in the website from TFA https://i.imgur.com/wIkaE5g.png which was the reason why I mentioned it, although it certainly does not fit all possible use cases.