Pagespeed error ? - Wordpress

322 views
Skip to first unread message

Baraque Obahamas

unread,
May 27, 2015, 10:59:50 PM5/27/15
to ngx-pagesp...@googlegroups.com

Someone knows why I have some lines on my website from a mobile ? I use wordpress

https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Flebonstream.net&tab=mobile

It's the same with my phone (oneplus one). :/

Baraque Obahamas

unread,
May 27, 2015, 11:05:12 PM5/27/15
to ngx-pagesp...@googlegroups.com

Jeff Kaufman

unread,
May 28, 2015, 8:36:45 AM5/28/15
to ngx-pagesp...@googlegroups.com
Yes, I see this on your site on mobile with PageSpeed=on and not with PageSpeed=off:


This is a PageSpeed bug; thanks for reporting it!

The JS text that's getting shown here is from PageSpeed's critical image beaconing code, which gets inserted before the first image on the page, turning:

<a class="logo" href="http://lebonstream.net" title="Lebonstream | Un site utilisant WordPress"><img src="http://lebonstream.net/wp-content/uploads/2015/05/logo-header.png" alt="Lebonstream | Un site utilisant WordPress"/></a>

into:

<a class="logo" href="http://lebonstream.net" title="Lebonstream | Un site utilisant WordPress"><script pagespeed_no_defer="">(function(){var g=this,h=function(b,d)...pagespeed.CriticalImages.Run('/ngx_pagespeed_beacon','http://lebonstream.net/?a=b','bOk8u7_prl',true,false,'-tCPhA9VMdE');</script><img src="http://lebonstream.net/wp-content/uploads/2015/05/xlogo-header.png.pagespeed.ic.m4z1_NscpC.png" alt="Lebonstream | Un site utilisant WordPress" pagespeed_url_hash="1901629196" onload="pagespeed.CriticalImages.checkImageForCriticality(this);"/></a>

Because our critical image beaconing code doesn't need to run on every request, this is intermittent and harder to debug.  Here's a static copy of your site, though, that has this problem:


Here's a simplified page with the same problem:


The basic issue is that we're inserting JS inside a tag that you've set all the children of to "display: inline-block".

A fix is to put display:none on the js we insert:


$ diff repro-bad-js-issue{3,4}.html
7c7
< <script pagespeed_no_defer="">
---
> <script style="display:none" pagespeed_no_defer="">



> --
> 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.

Baraque Obahamas

unread,
May 28, 2015, 12:13:00 PM5/28/15
to ngx-pagesp...@googlegroups.com
Thank you for the fix! But I don't know where found <script pagespeed_no_defer=""> - can you help me ?

Thank you

Jeff Kaufman

unread,
May 28, 2015, 1:45:09 PM5/28/15
to ngx-pagesp...@googlegroups.com
Sorry, this is something that has to be fixed within PageSpeed. We're
adding a fix to a bugfix release we're preparing now.

As a workaround, you could disable the beacon js, which is what's
causing this problem:

pagespeed CriticalImagesBeaconEnabled false;

https://developers.google.com/speed/pagespeed/module/config_filters#beacons

Baraque Obahamas

unread,
May 28, 2015, 2:09:43 PM5/28/15
to ngx-pagesp...@googlegroups.com
Ok ok, it's done :) Thank you
About memcached, can I activate it or pagespeed take care of the pages cache ?

Jeff Kaufman

unread,
May 29, 2015, 7:25:17 AM5/29/15
to ngx-pagesp...@googlegroups.com
PageSpeed caches optimizations on your disk by default. If you'd like
it to use memcached instead, perhaps because you have multiple servers
which could share a cache, see:
https://developers.google.com/speed/pagespeed/module/system#memcached
Reply all
Reply to author
Forward
0 new messages