If you’re getting into everything that is optimizing site load times, you probably heard about the Document Object Model or DOM. The DOM is an API of the HTML and XML model (how many acronyms!). We go for a part. API stands for Application Programming Interface and serves to do what its name explains: interact with an application through code. Through the DOM, programmers can create documents, navigate and add, edit or remove elements, modify their attributes and alter their values. Speaking badly and soon, the DOM is the structure or skeleton of your website.
When a page is loaded, a <script> tag can stop the download of the Document Object Model until it is finished processing and then continues. This can be problematic if you have a heavy script in the <head> of the code or in the upper part of the <body> above the main content of the page. If so, the content would not be visible until the code finishes processing. We all happened to be browsing on a page that loads and loads and after a few seconds all the content, images, etc. appear. suddenly. Most likely, in such cases, there is a script that is slowing the DOM to load and display quickly.
<script src = "miscript.js" async> </ script>
In short, if you want to have a fast page load time, the first step is not to slow down the DOM . In following posts we will explain more about how to optimize a web page so that it loads faster.
We hope that this brief explanation about what is the DOM or Document Object Model has served to understand a little more the importance of it when it comes time to reduce the loading of a site.