Filter to avoid line breaking

8 views
Skip to first unread message

Hugo M.

unread,
Feb 2, 2015, 3:32:41 AM2/2/15
to ngx-pagesp...@googlegroups.com
Hello.

There is a filter to "collapse whitespace", but there is one to avoid line breaking?

For example; from this:
<!DOCTYPE HTML>
<html prefix="og: http://ogp.me/ns#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="UTF-8">

To this:
<!DOCTYPE HTML><html prefix="og: http://ogp.me/ns#"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta charset="UTF-8">

I am used to have my pages cached without line breaking – but now, using pagespeed, I start asking if is really makes a difference, since I can't find the right filter for this function...
Anyone can bring real data about this?

Thank you, Hugo.

Jeff Kaufman

unread,
Feb 2, 2015, 8:15:42 AM2/2/15
to ngx-pagesp...@googlegroups.com
The problem is that many pages rely on the linebreaks being where they are.

As a simple example, if the html says:

Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Fusce molestie ante <b>vitae</b>
iaculis varius. ...

Then collapsing whitespace while also removing newlines would make
"<b>vitae</b> iaculis" into "<b>vitae</b>iaculis", which would be one
partially-italicized word instead of two.

More discussion: https://github.com/pagespeed/ngx_pagespeed/issues/868
> --
> You received this message because you are subscribed to the Google Groups
> "ngx-pagespeed-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ngx-pagespeed-di...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ngx-pagespeed-discuss.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages