lazyOnLoad
lazyOnLoad
works the same way as scripts using afterInteractive
. However it will only be loaded during idle time. Next.js uses the window.requestIdleCallbackmethod to check if browser is idle.
Third party scripts that have the lowest priorities should be loaded using lazyOnLoad
strategy. For example, third party for comments (that is if comments is something not hugely important).
Sample Code