GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — Add RFC for adding support for prefetching critical images by KyleAMathews · Pull Request #35 · gatsbyjs/rfcs
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
Conversation
|
|
Some notes I hope help with the design:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@addyosmani thanks for the notes! I wrote up one possible work around for prefetches lack of persistence at gatsbyjs/gatsby#12800 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We can't rely on people having SW available and in any case, we want prefetching to always low priority which is only easily achieved right now with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Another related optimization this RFC will enable — we use the IntersectionObserver API to lazy load images. Because loading images is a heavy operation (both bandwidth & CPU to render it on the client) we don't start loading the image until the user has scrolled close to the image. But this isn't ideal as it means that on slower connections or if the user is scrolling fast, that images will be delayed in displaying as the browser won't be able to download them fast enough. Prefetching images is a pretty light-weight way to get ahead of things as it won't block anything else. So we could add another IntersectionObserver that watches much further ahead and starts prefetching images ahead of time. This would again contribute to making Gatsby sites appear quick and smooth. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We'd probably put the image prefetching code into its own package e.g. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc @jlengstorf re: per-page MDX and shortcodes discussion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.