How to avoid an excessive DOM size?

How to avoid an excessive DOM size?

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.

IMG 20211126 WA0005

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

  1. As I mentioned before, JavaScript issues are often the cause of slow page loading.
  2. As developers struggle a lot to find the exact weak point in JavaScript.
  3. Fortunately, with the User Timing API, it is no longer a problem.
  4. The main objective of this service is to measure the performance of the JavaScript in your application so that you know which parts of your scripts are lagging and require optimization.
  5. All you need to do to measure the performance of your JavaScript-wise application is access the results from JavaScript using an API.
  6. After you identify the areas that need improvement, you can go ahead and fix them.

IMG 20211126 WA0004

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?

  1. 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:
  2. I know this article is long and full of technical stuff.
  3. However, I still highly recommend taking the technical side of website speed up seriously.
  4. So far this is what affects your speed score the most.
  5. What’s more, you should keep your eyes on the real-world measurements from CrUX.
  6. 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.

Leave a Comment

Scroll to Top