|How-to||– 9 min read –||September 17, 2019|
How to compress HTML code in order to reach a higher website loading speed
Why do you need to compress code size
What is the compression of HTML code
The following is an example of how to minimize the source code. This is how the code looks like before optimization:
This Is an example before optimization:
How to optimize HTML
- manual: suitable for those who can work with HTML conversion;
- using special plugins and services: suitable for all webmasters.
To find non-optimized files, you can use the GTmetrix service.
W3 Total Cache
- improve website performance by ten times;
- speed up the web page loading time;
- improve server performance;
- optimize progressive visualization so that pages can render faster.
Below is an example with the website results before and after applying the plugin.
- go to the admin panel;
- on the left side menu, select the "Plugins" section;
- after that select "Add New":
- enter "WP Super Cache" in the search bar;
- click "Install Now";
- activate the plugin. Before activation, you must disable other caching plugins.
How to configure the plugin:
- go to the "Settings" plugin to enable caching, and refresh the tab;
- in the Settings tab, check "Enable caching", "Compress pages" and select "Refresh".
Other services to compress HTML code
Optimization of header files
- Obfuscate the JS code, thereby compressing the source code. It removes unnecessary symbols and makes changes to the code itself; the ShrinkSafe utility is used;
- compress the CSS code;
- clear html code from junk fragments.
Other parameters that are important to consider during layout
- Cross-browser compatibility: the ability of web pages to display correctly in different browsers;
- adapted mobile version: Google has been considering this since 2015;
- content placement: it is undesirable to hide it under "display: none";
- misuse of tags: if tags intercross the behavioral factors will get worse, for example: <strong>, <b>, <em> & <a href>.
Here are the plugins that facilitate minimization for WordPress websites:
There are also off-line tools developed that can optimize code. All you have to do is move it to your website.
By doing some manipulations, you can speed up the loading process, improve behavioral factors and, finally, increase ranking of the promoted resource in the search engine.
This article is a part of Serpstat's Checklist tool
|Try Checklist now|
Learn how to get the most out of Serpstat
Want to get a personal demo, trial period or bunch of successful use cases?
Send a request and our expert will contact you ;)
Cases, lifehacks, researches and useful articles
Don’t you have time to follow the news? No worries!
Our editor Stacy will choose articles that will definitely help you with your work. Join our cozy community :)