I've done a page speed ranking of some websites that I manage for work and the score was very poor. I'm evaluting the possibility to build a custom plugn to add the async
or the defer
attribute to all the needed scripts that are enqueued in the function file except for jQuuery and the main.min.js file of my custom theme.
What is the best option to choice between these two attribute?
Can be the use of webpack to compress all files inside one a good choice?
I'm using swiper, universal-parallax and lazyLoad as dependency for some functionality of the theme I run on these installations, but I think that these libraries can be loaded after the DOM is parsed and loaded also if they are used in the main js file of the theme. Another thing that I want to do is to create a subdomain that will act as CDN for the scripts and eventually also for the images used in page or posts. Can b this a good choice and how I can then manage the uploads to be done on the dedicated cdn and not on the wp-upload folder?
For the css, is there a solution like the async
and defer
?
Thanks for the clarifications and help about.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744962359a4603466.html
评论列表(0条)