-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document next-prefetch
#24
Comments
I'd like to help with this. Has there been a decision on whether it's going to be rewritten or if it's gonna be extracted from the zeit.co implementation? If it needs to be written from scratch, we should create a new repo for this to start working on this implementation. |
That would be fantastic! React-boilerplate seems to be doing similar, and it falls back to AppCache on older browsers. It seems to rely on Webpack It seems like page prefetching and caching can be a great feature to not only provide speedier page loads, but even provide offline availability? I think offering "offline" and "low-bandwidth" abilities could make Next.js quite attractive, especially with the huge amount of users in emerging markets. In combination with e.g GraphQL, it could compete against Firebase which has an offline feature (React-boilerplate also advertises itself as offline-first). To make things straightforward to the user, could prefetching be offered out of the box (no API change) so that users can see its full potential right away, like offline-plugin does? (If necessary, allow to disable through configuration.) |
Also see Create React PWA based on create-react-app, Chrome sw-precache and sw-toolbox, to create progressive web apps. It also shows how to have an "add to home screen" link (see blog post with short demo video). Not saying all of this should be implemented right away, but definitely prefetching/caching would help with all of that. |
@sedubois That sounds perfect. Let me go through those resources and begin working on this. Anyone else who wants to help, that'd be awesome |
Exactly what is being discussed right now at https://developer.chrome.com/devsummit/ |
Thanks @ugiacoman, is there any way to view the talk or related article? |
@sedubois It looks like they haven't archived the stream yet. A few good pieces that I have read involves service workers. It seems incredibly easy, and it would be incredible if Pre-fetching with Service Workers |
@rauchg how can I help with this? It's a big want for my team 😉 |
Guys, I did a PR implementing page prefetching. cc @jbaxleyiii :) |
@arunoda any future plan for fallback to AppCache? |
@sedubois we will add some fallback support with AppCache or something similar. |
Any idea on whether this will make it into a release of next.js anytime soon? |
It's already in master |
next-prefetch
is a substitute for<Link />
(builds on top of it) that:ServiceWorker
prefetch={false}
if you want to turn it offfallbackWorker={true}
to fallback to a web worker if the browser doesn't support service workers.This is the technique that we use at ▲ZEIT to make everything really speedy.
We need to extract it out of our impl or someone can write this from scratch.
Installing a service worker is pretty intrusive, so I don't think this is something we want in core. We can write it as a separate module.
The text was updated successfully, but these errors were encountered: