-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby-plugin-offline): skip prefetching all resources #16691
fix(gatsby-plugin-offline): skip prefetching all resources #16691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great change. This will fix over fetching assets which is great! I added a few comments which I think makes this change a little bit better. Feel free to decide otherwise 😉 I'm happy to hear your thoughts.
Hi @rexxars 👋 Did you find time to address Ward's comments? Would be awesome to have this merged in! Thanks a lot :) |
Will have a look later today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after changes! 👍 Thanks, this is a great change! We reduce bandwidth and lower the amount of logs saying that a preload has been triggered but left unused.
Thanks for fixing, I kind of forgot about this 😊 |
I'm going to merge this one, if we need to rollback, we'll rollback :) |
Description
If you have a plugin which uses the
setHeadComponents
API to add link-tags with apreconnect
rel, the offline plugin will schedule it to be prefetched. This leads to the situation where instead of simply opening a connection to the specified host, it instead triggers a GET-request.I'm not 100% clear on what should happen if you have
prefetch
orprerender
links, but I feel like skipping them is probably a better option that to add another prefetch for them? Would love to hear your thoughts on this, though.Related Issues
Fixes #15883