最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论