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
Link Prefetching: also prefetch pageContext
#246
Comments
My idea so far for this is to:
|
onAfterPreload
hook for client routerpageContext
I agree with you, that sounds very simple and straightforward. |
With 0.4 the DX is quite straightforward: // /renderer/_default.page.client.js
export const prefetchStaticAssets = { when: 'VIEWPORT' }
export const prefetchPageContext = { when: 'HOVER', expire: 10 * 1000 } Implementation should be fairly easy. |
@archit-p It isn't but this feature can be implemented independently of the V1 design. PR welcome! |
Hi, @brillout! |
Hi @usk94, yes! |
@brillout |
So far I'm inclined to think that we can enable it on
I think that would be nice? Or do you see an issue with that? |
@brillout
I don't have at the moment. I just asked to be sure, thank you! |
Just sharing my interest in this issue :) Two considerations:
Loving vike for static sites! ❤️ |
I'm not sure I understand your first point. The second point makes a lot of sense, although it isn't the focus right now to make it perfect (the sponsor who requested this feature doesn't use SSG). Let's see. |
Currently, there's no way to do any user-defined additional preloading jobs after finishing to preload static assets. So it's impossible to prefetch data needed for routes. Having an
onAfterPreload
hook (tried to match the naming convention) will solve the problem and it'll be very helpful to deeply tune the page performance.The text was updated successfully, but these errors were encountered: