Minifying HTML Documents
Minification (or compression) of an HTML document is the practice of removing unnecessary white spaces, without affecting the functionality of the document, but significantly reducing the loading time in Web browsers. While a minified HTML document gains in terms of execution performance, it is more difficult to read.
To minify an HTML document, right-click anywhere in the editor for an HTML document that is open in Text mode (or right-click an HTML document in the Project Explorer view and select the Minify HTML action. This opens a dialog box with the following options:
- Output file
- Use this option to set the name and location of the resulting compressed/minified HTML document.
- Remove comments
- If selected (default), all the HTML comments and also the comments from embedded CSS or JavaScript code blocks will be removed from the resulting output file.
- Compress on a single line
- If selected (default), the resulting output file will consist of a single line, as all the 'new line' characters from the source document are removed.
- Open output file in editor
- If selected (default), the resulting output file will be opened in Oxygen XML Developer Eclipse plugin.
When you click OK, the resulting HTML document is a compressed version of the original file for the purpose of enhanced performance, while losing some readability. The source HTML document is not affected.