Several reasons for not compressing HTML

Several reasons for not compressing HTML
The reason is simple:

In HTML documents, multiple whitespace characters are equivalent to one whitespace character. In other words, it is unsafe to delete whitespace characters such as line breaks, as this may cause differences in the styles of some elements.
In HTML elements, there is a pre, which means preformatted text. Any whitespace inside it cannot be deleted.
It is possible to have IE conditional comments in HTML. These conditional comments are part of the document logic and cannot be removed.
I only think of the above 3 points, there may be other pitfalls. For dynamic pages, HTML compression may increase the CPU burden on the server, which is not worth the cost.

Generally speaking, gzip compression can achieve good results. There are pitfalls to further compression, and unless you have tested it as thoroughly as Google has (Google only compresses a small number of core service pages), it is not recommended to compress HTML.

<<:  Detailed explanation of JavaScript timers

>>:  Solutions to invalid is Null segment judgment and IFNULL() failure in MySql

Recommend

Make a nice flip login and registration interface based on html+css

Make a nice flip login and registration interface...

Vue3+script setup+ts+Vite+Volar project

Table of contents Create a vue + ts project using...

JavaScript implements simple scroll window

This article example shares the specific code of ...

How to use native JS to implement touch sliding monitoring events

Preface I wrote a small demo today. There is a pa...

How to get the size of a Linux system directory using the du command

Anyone who has used the Linux system should know ...

Centos 7 64-bit desktop version installation graphic tutorial

If you think the system is slow and want to chang...

HTML optimization techniques you must know

To improve the performance of web pages, many dev...

Basic usage knowledge points of mini programs (very comprehensive, recommended!)

Table of contents What to do when registering an ...

The whole process of implementing the summary pop-up window with Vue+Element UI

Scenario: An inspection document has n inspection...

Example code for implementing complex table headers in html table

Use HTML to create complex tables. Complex tables...

Node+Express test server performance

Table of contents 1 Test Environment 1.1 Server H...

A set of code based on Vue-cli supports multiple projects

Table of contents Application Scenario Ideas Proj...

Vue calls the computer camera to realize the photo function

This article example shares the specific code of ...