Reputation: 141
Avoid an excessive DOM size issue is showing in Google Pagespeed Insights results. How can i resolve this ? Please mention the ways to reduce it. My website is a wordpress website.
Upvotes: 2
Views: 20241
Reputation: 21
Without completely redesigning your web page from scratch as i did here, you cannot resolve this warning. you should not neglect this if this warning is more than one page on your website, you should consider following points.
Upvotes: 0
Reputation: 605
The non technical answer would be to minimize your WordPress website DOM size is by loading fewer resources to reduce the DOM size and you can do that by many way such as:
Technical feedback (adding from Google pagespeed recommendation) :
A large DOM tree can harm your page performance in multiple ways.
Network efficiency and load performance. If you server ships a large DOM tree, you may be shipping lots of unnecessary bytes. This can also slow down page load time, because the browser may be parsing lots of nodes that aren't even displayed above-the-fold. Runtime performance. As users and scripts interact with your page, the browser must constantly re-compute the position and styling of nodes. A large DOM tree in combination with complicated style rules can severely slow down rendering. Memory performance. If you use general query selectors such as document.querySelectorAll('li') you may be unknowingly storing references to a very large number of nodes, which can overwhelm the memory capabilities of your users' devices. Recommendations An optimal DOM tree:
Has less than 1500 nodes total. Has a maximum depth of 32 nodes. Has no parent node with more than 60 child nodes.
Upvotes: 3