Optimization Opportunity through using <link rel=preload> for the service-worker in react-pdf

Viewed 221

I am using very wonderful react-pdf along with the webpack. Service worker runs and everything works fine. However, when i run the Lighthouse tool, it suggest me that i could save upto 8.45 sec if i use <link rel=preload> for the pdf-js service worker.

I added the <link rel=preload>, but now i want to add it to the document when needed. Otherwise it is anyway being fetched again. I don't know what is the best place to do it. Will really appreciate any help.

0 Answers
Related