H @m_uysl,
Note: I don’t know why this thread was marked as “NSFW” after I posted it.
Understood about the DOM minification option. I wasn’t planning on using that option. I just wanted to report it at the same time.
Putting that aside, I want to circle back to my original report of the base “Minify HTML” option alone not having any effect. (I have “Optimize HTML via Dom Parser” disabled in this case.)
When I compared the HTML source after enabling it that one option, it looked like it had no effect, but after closer inspection, the minification does have a minor effect that I only noticed when I did a line-by-line text comparison.
For instance, here’s a portion without minification enabled:
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
And here’s where it looks like after powered cache minification is enabled:
<!doctype html><html lang="en-US"><head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'/>
<meta property="og:locale" content="en_US"/>
<meta property="og:type" content="website"/>
Notice how it:
- didn’t remove most EOL (new end of line) characters
- didn’t remove any spaces at the beginning of lines
Yet it removed the space between the self-closing HTML tags [space]/>
to />
It seems like once it gets to a
/>
It breaks the processing flow.
The self-closing tags above are minified throughout the page, mostly in <img />
to <img/>
tags. The rest of the document is left untouched and unminified.
That is until you get to the closing body and html tags, which gets minified:
Here’s the before, without minification:
</noscript>
-->
</body>
</html>
And here’s after minification enabled:
</noscript>
-->
</body></html>
In the meantime, I’ve added in the “Minify HTML” plugin to minify output, which works well with Powered Cache, and doesn’t remove the <!-- Cache served by Powered Cache -->
string at the end, even though it has an option to remove all other HTML comments (which I’ve enabled).
Thanks.