Enma
September 25, 2021, 12:44am
1
Hi Tim!
I watched your video on experimenting with service workers and WebPageTest. Wonderful stuff!
It made me wonder if is it possible to experiment with preload/preconnect using Inject Script. Is it?
I found these two amazing snippets, but they didn’t seem to work for me:
Do you know of a resource that can help?
Thanks!
pmeenan
September 26, 2021, 1:24pm
2
Do you have a test result URL with a preconnect or preload that isn’t working that you could share? If it is for a font, make sure you are using “crossorigin” but depending on the resource type, if it is already in the HTML and parseable, the browser may already be discovering it as fast as possible.
Enma
September 26, 2021, 3:32pm
3
Hi Patrick,
Thanks so much for chipping in.
Here is the original test: https://www.webpagetest.org/result/210923_AiDcDT_fe5b1b12fc248488ed783a6cc467b061/
Here is the test with preconnect (script from Andie Davis’ article): https://www.webpagetest.org/result/210926_BiDcGG_b04abe0235b5cb1111d8fe536682adc0/
And here is the script with preload (script from Hariom Balhara’s article): https://www.webpagetest.org/result/210926_AiDc83_c6fd8f3edbbf12d8368312146eb9adb0/
It’s for an image in this case. Maybe I’m doing something wrong, obviously.
Greatly appreciate your input.
Thank you!