Question

I tried to minify html as a way to increase page load speed, by recommendation of Google Page Speed.

When I minified the html code, the site broke. Just a blank white page.

I checked Github and saw an issue regarding minification but I doubled checked the files on my install and they contain the patches which were supposedly release with Magento 2.1.2.

Does any one have any insight into why minifying html would throw a black front page?

I did do the following after setting the "Minify Html" dropdown to "Yes":

  1. Cleared all caches.
  2. Cleared pub/static and var directories.
  3. Ran compile.
  4. Deployed static content.
  5. Refreshed caches.

The blank page is only on the front end. Could someone point me in the direction to showing what errors are happening, or if this has happened to you as well, please do share.

**I searched and all I could find was information on the BIG minify js problem, which I have as well, but can't do anything about.

Thanks in advance.

Was it helpful?

Solution

I have had exactly the same problem as you was having.

When i made a production site i also tried enabling everything that had to do with caches as well as the html minification.

What you could do is checking the php error log on your webserver. There you can see exactly which file is causing you trouble. It probably has something to do with php tags like this:

<?php //samplecomment?> <--- this breaks it!
<?php //samplecomment ?> <--- this doesn't break it

You can read more about this here: https://github.com/magento/magento2/issues/5316

OTHER TIPS

Also, I found out that slashes in HTML comments break the template, eg.

<!-- // End section -->

Should be

<!-- End section -->
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top