php - Improve page speed loading using CDN and async or defer attribute

I've done a page speed ranking of some websites that I manage for work and the score was very poor. I'm evalut

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

相关推荐

  • php - Improve page speed loading using CDN and async or defer attribute

    I've done a page speed ranking of some websites that I manage for work and the score was very poor. I'm evalut

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信