EbrahemSamer's avatar

should I put all script in the footer and include footer in all pages ?

I've some slow web pages while loading content and I did know that many script have unused bytes.....

is this the reason why I've slow web page or there are other reasons ?

0 likes
1 reply
Tray2's avatar

If you have done the chaching properly it will only pull your javascript from the server once and then use the cached versions for all the pages. So it shouldn't matter that much.

That being said, page specific javascript would most likely benefit from being loaded on just that page.

https://laravel.com/docs/8.x/mix#versioning-and-cache-busting

Please or to participate in this conversation.