4 ms·
It's pretty simple. Use a regex to eliminate whitespace and then gzip. Be sure to set the proper headers if you gzip. I eliminate whitespace with the following
by maratd 14y ago
It's pretty simple. Use a regex to eliminate whitespace and then gzip. Be sure to set the proper headers if you gzip.
I eliminate whitespace with the following PHP code:
preg_replace(['/\t+/', '/>\s+</'], [' ', '><'], $html);