Pagespeed rewrote my index.php (and made a mess of it)

329 views
Skip to first unread message

Marc de Ruyter

unread,
Dec 18, 2016, 5:25:49 PM12/18/16
to mod-pagespeed-discuss
I understand that mod-pagespeed rewrites webpages (html, php, css , js etc) that Apache sends to the requesting browser.
But, i did nit expect to find my index.php rewritten. The php includes where, literally, included and written to index.php and the index.php is now full of pagespeed data, for example: script data-pagespeed-no-defer and then a huge [DATA] block full of javascript with things like checkimageforCriticality etc etc

This could not be expected behaviour, is it?

Using Apache 2.4.18 (Ubuntu)

And, i got a syntax error in pagespeed.conf on line 67:
ModPagespeedEnableFilters combine_css, defer_javascript

For niw, i set ModPagespeed off

Joshua Marantz

unread,
Dec 18, 2016, 11:18:58 PM12/18/16
to mod-pagespeed-discuss
Just to clarify, mod_pagespeed rewrites the HTML in server-memory, and does not change your PHP source on disk.

The example you give of finding critical images is a good one.  mod_pagespeed inlines small images that are rendered above-the-fold, and to figure that out it occasionally injects a JavaScript beacon into the HTML.  Another example is combining or inlining CSS and JavaScript files.

If you want your HTML to remain unoptimized, you might want to consider using OptimizeForBandwidth.    That will just optimize the CSS, JS, and Image files as they are served, and will not touch the HTML.  However, most of the latency and caching benefits require some HTML modification.

I think the syntax error is due to the space in between "combine_css," and "defer_javascript".

-Josh



--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/e306808e-4ad4-4886-9369-4cd766e6765d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages