Category: 

What Is a HTML Compressor?

Article Details
  • Written By: Benjamin Arie
  • Edited By: Shereen Skola
  • Last Modified Date: 23 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
President Richard Nixon had an entire speech prepared in case the Apollo 11 astronauts became stranded on the Moon.  more...

December 8 ,  1965 :  Pope Paul VI promulgated Vatican II into ecumenical law.  more...

A HyperText Markup Language (HTML) compressor is a computer application that deletes unneeded characters from an HTML code file. This type of program is also known as a "minifier," since it reduces the code to the minimum possible size. An HTML compressor strips irrelevant areas of the code, but still allows the program to function as it was intended. The primary purpose of an HTML minifier is to shrink the size of Internet files to increase the speed of a website.

Worldwide, HTML code is one of the most widely used programming languages for websites. Web browsers use HTML code to determine the content and layout of a page. Organizations such as the World Wide Web Consortium (W3C) have published guidelines for the recommended structure of an HTML file. Despite these guidelines, there are a variety of approaches that a website programmer can use when coding a page. In many cases, the code is "over written" and is more lengthy than necessary.

An HTML compressor analyzes the content of a code file and removes redundant elements. Non-essential comments placed by programmers, for instance, are automatically removed. Spaces between elements and lines of the code are also deleted. These "white space" areas allow human programmers to easily interpret the code, but are unnecessary for HTML browsers.

Ad

In addition to removing unnecessary comments and spaces in a file, an HTML compressor can also delete other irrelevant programming expressions. Many HTML programs include a closing "tag" that indicates the end of a paragraph or other layout area. While these closing tags are logical, modern browsers do not require them. Some varieties of HTML compressor will minimize the code by locating and removing these tags.

A compressor can also modify lengthy code components, and abbreviate them when possible. Some of the code used in a web page can be written in either a long or short format. For instance, the HTML code "" will cause an area of text to have a crossed-out style. An HTML compressor can replace these elements with the shortened term "," which accomplishes the same task.

It is not uncommon for an HTML web page to contain hundreds or even thousands of code lines. By eliminating every redundant area, a compressor can dramatically reduce the size of the entire file. This can significantly increase the overall speed and efficiency of a website, and minimize the data bandwidth necessary to load each page.

Ad

You might also Like

Recommended

Discuss this Article

Markerrag
Post 2

@Melonlity -- Don't just minify your CSS. You should also compress your CSS code, images and other scripts running on your site. Again, there are plugins available for that if you host your site yourself. The goal here is speed, folks.

Melonlity
Post 1

One of the biggest mistakes bloggers make is not minifying HTML code. That leads to long page load times and can actually negatively impact the search engine ranking of a site because the companies that run those things don't want to encourage long load times.

How can one minify code? Most blogging platforms have plugins that a user can download to do that. Those are typically pretty safe and will boost the load time of your site.

If you are enrolled in one of those free blogging services, there's a good chance the minify task is done for you in the background. If you are self hosting a blog, though, installing a plugin should be one of the first things you do after you build your site.

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email