Skip to content
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

Add rel attribute 'prefetch' on style tag builders #55

Open
wants to merge 1 commit into
base: master
from

Conversation

@shanemac10
Copy link

shanemac10 commented Sep 26, 2019

Using 'prefetch' can be handy for performance bumps, similar to using 'defer' or 'async' on script tags. Google Lighthouse advised we 'Remove unused CSS' that was costing ~0.55s of load time. Some of the style was being added by w3-total-cache, that we use for forms later on, so we want to cache it. Adding 'prefetch' to these places did not cause any issues that we have found, and effectively deferred the style loading until the browser is freed up.


Link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might visit in the near future. A web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and stores them in its cache. When the user visits one of the prefetched documents, it can be served up quickly out of the browser's cache.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ

Link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might visit in the near future. A web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and stores them in its cache. When the user visits one of the prefetched documents, it can be served up quickly out of the browser's cache.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ
@shanemac10

This comment has been minimized.

Copy link
Author

shanemac10 commented Oct 4, 2019

So upon further experience and investigation, we have had issues with Internet Explorer using prefetch. It completely broke the style of the website we implemented this on. All other browsers worked great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.