Search code examples
htmlminifypagespeed

Question about serving one line only minified HTML pages


For a reason my websites new version produce pages with HTML code in one line only, sort of minified HTML. That is to say from html to /html it is one line regardless of amount of content.

For another reason, i'm a litlle bit anxious about releasing this code live, because i'm fearing a possible SEO issue on serving one line only HTML files. Sure that is just a feeling having no information on this, and that may be weird feeling, still i'm fearing it, A LOT. See all business is somewhat linked to SEO. In other hand, tested new version again Google Page Speed online increased original score by a confortable amount.

So, fear for nothing ? Do any of you have input on this, can this affect SEO ranking ? Is this good practice also (provided it does not affect at all any process of webdev nor any server perf issue) ?

I was also wondering if browser had not a kind of "differential" source code rendering, that is if the browser see the exactly same header that previous page it will show quickly. Thus i told me : hey, this feature might be break if the browser is feeded with one line only, it may not fire differential recogn till no line break to tell him to stop parsing first line...

Well, hem, you see... Not sure of doing this right. Forgive if its naive fear.

Thanks for your thought on this !


Solution

  • I don't think that having all the HTML in one line is going to affect SEO - after all, the HTML structure has to be parsed. The parser doesn't care about whitespaces.

    This is just my reasoning though - I'm not sure whether anybody will be able to give you a definite answer.

    If you're worried, consider not doing this at all. Compared to the savings that you get from gzip compressing your HTML, saving a few bytes in line breaks is almost meaningless.