How to avoid an excessive DOM size? A very large DOM tree with complex pattern rules can have a negative impact on things like speed, runtime, and memory performance Best practice is to create a DOM tree, with fewer than 1500 nodes, with a maximum of 32 nodes, and no master node with more than 60 subcontracts.
DOM size is one of SEO basics to improve your website or page in search engines to be preffered to appear in the top search.
How to avoid an excessive DOM size?
We will mention in the following lines How to avoid an excessive DOM size? in detail:
All DOM nodes must be removed from the site in order to speed up the site well.
For this reason, consider removing nodes that are not currently displayed from the uploaded document.
Try to create it only after the user scrolls down the page or clicks the button.
Reducing the depth of important requests
- The critical demand chain is part of the Critical Path Strategy (CRP).
- That underlies the basic idea that prioritizes the loading of certain resources and changes the order in which they are loaded.
- Although the critical request chain is intended to download the most important resources, it can be reduced.
- There is unfortunately no one-size-fits-all advice on exactly how to reduce the depth of critical requests for your site (as are many of the factors mentioned above).
- However, it is always a good idea to reduce the length of threads, reduce the number of downloaded resources, and as usual delay downloading unnecessary resources.
User timing marks and performance measurement
- Fortunately, with the User Timing API, it is no longer a problem.
- After you identify the areas that need improvement, you can go ahead and fix them.
you can read also: How to make a backup of your WordPress website
Execution of the caching policy
- When the browser requests a resource, the server supplying the resource can make the browser store it for a certain period of time.
- So, for all repeat visits, the browser will use a local copy instead of fetching it from scratch and this is the best answer to the question How to avoid an excessive DOM size.
- In order to automatically control how and when the browser responds, use the cache control.
- In addition to HTTP caching, optimizing the lifetime of scripts (maximum age), and providing validation tokens (ETags).
- Don’t forget about the Service Administrator cache, including temporary storage.
How to speed up a website?
- We will mention website acceleration tips after we answered the question How to avoid an excessive DOM size so that users will understand the ways to speed up the site well:
- I know this article is long and full of technical stuff.
- However, I still highly recommend taking the technical side of website speed up seriously.
- So far this is what affects your speed score the most.
- What’s more, you should keep your eyes on the real-world measurements from CrUX.
- Because even if you have a speed score of 100, the web page may seem slow to users due to poor internet connection or outdated hardware.