-
Notifications
You must be signed in to change notification settings - Fork 109
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
Time in view before prefetching #23
Comments
I like this idea, and I took some time to improve it a bit with more options. Let me know what you think! For the shake of simplicity and flexibility I would allow two options:
This would be as global config, but I think it would be useful if we allow to overwrite this parameter individually in each link with data attributes optinally. In the code can look like: <a href="./link.html" data-prefetch-on="hocus" />
<a href="./link.html" data-prefetch-after="500" />
<!-- Combining them -->
<a href="./link.html" data-prefetch-on="visible" data-prefetch-after="200" /> In summary
|
I'm really interested in this approach, and after seeing the work done, I'd like to help in some way. BTW I have some ideas on prefetching that would extend the functionality, making it work for certain types of use cases. I don't think the discussion belongs here, so I will detail it in a separate post, something akin to a feature request. |
Looks good, could probably include configs for opting in prefetching on specific links as well as opting out. |
One way to solve the many prefetch calls on a page and still have a fast experience would be to add the possibility to pass a time argument to the prefetch attribute. It could look like this
prefetch?: 'visible' | 'hover' | 'time'
.Also, after testing a page, you can see what links are hotter (are accessed more) than others and set them a lower prefetch time than the links that are not clicked as much.
Good idea yay or nay?
The text was updated successfully, but these errors were encountered: