defer_javascript breaking site

44 views
Skip to first unread message

in...@dutchcarparts.nl

unread,
Aug 23, 2016, 5:08:16 AM8/23/16
to mod-pagespeed-discuss
Hallo,

During the vacation our servers (and mod_pagespeed) were updated....

    Updated     mod-pagespeed-stable-1.9.32.14-0.x86_64                @mod-pagespeed

    Update                           1.11.33.2-0.x86_64                @mod-pagespeed


This broke the site.

I quickly realised that this was a javascript issue and disabling defer_javascript solved the problem.

Now I want to re-enable but even disallowing all javascripts still breaks the site.


In the past I had to disallow jquery.min.js and jquery-ui.min.js to be able to defer the remaining javascripts without breaking the site....


Is this a html issue?

How can I solve it?


Thanks, Dimitri








Jeff Kaufman

unread,
Aug 23, 2016, 9:59:01 AM8/23/16
to mod-pagespeed-discuss
I'm sorry that update broke your server while you were on vacation!
That sounds like a pain.

Is this on dutchcarparts.nl? Looking at that site with and without
?PageSpeedFilters=+defer_javascript I do see problems. Primarily, I
see defer_javascript breaking the left sidebar, but there are a couple
other changes.

Looking at the js console, with defer_javascript disabled I see no js
errors, but with it enabled I see:

if(phpData.radio1 == 1)

getting:

Uncaught ReferenceError: phpData is not defined

That error is in /public/js/main.js, which is not deferred. Do you
have main.js disallowed in your pagespeed configuration? Along with
cycle.js and a few other jquery Otherwise, I'm very surprised to see
it not being deferred.

phpData is defined in the first block of inline javascript, which
should be the first thing defer_javascript executes when it starts
running. But because main.js isn't deferred, and sets js to run on
document.ready, that happens first, and there's your js error.

Instead of fixing this, though, I think you should probably just
disable defer_javascript for this site. You use JS for rendering, so
deferring it doesn't make sense. Additionally, you currently have
jquery and jquery-ui, among other things, set with
data-pagespeed-no-defer, so it's not even deferring very much for you
right now.

Jeff
> --
> 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-di...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mod-pagespeed-discuss/bdfc5f08-1959-4640-9d6f-25b8e2dee24d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

in...@dutchcarparts.nl

unread,
Aug 23, 2016, 3:48:06 PM8/23/16
to mod-pagespeed-discuss
Hallo Jeff,

Thanks for your reply and my excuses.... I still had all javascripts disallowed.
The problem isn't solely deferring javascript, it's the bounce rate!

It took me a while to get the right combination of filters to reduce the bounce from around 50% to under 5%.
Without defer I can't keep the bounce rate low. :( 













Any further help would be appreciated!


Jeff Kaufman

unread,
Aug 23, 2016, 4:00:44 PM8/23/16
to mod-pagespeed-discuss
Your graph shows a bounce rate that's in the low single digits suddenly spiking to ~50% around 7/27.  Is 7/27 when you upgraded to 
1.11.33.2-stable?

A low single digits bounce rate is low enough that I'd be worried about measurement error.  Could it be simply that defer_javascript delays your analytics js until after the point at which most bouncing users have left your page?  And so the remainder that it's able to count rarely bounce?  My guess is that the bounce rate you see with defer_javascript disabled is the real bounce rate, and the one with it enabled is bogus.

As a way to verify this, did your non-analytics measurements have a similar sharp change on 7/27?  For example, were you making a relatively consistent $X/day and then on 7/27 this dropped to $0.5X/day?  That's what I would expect to see if your true bounce rate had jumped from 5% to 50%.

--
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/46a701a1-726f-42f3-828d-367bf50dbb61%40googlegroups.com.

in...@dutchcarparts.nl

unread,
Aug 23, 2016, 4:59:31 PM8/23/16
to mod-pagespeed-discuss
Hello Jeff,

You could be right.
I see a 15% drop in orders but that could also be the vacations.....
I will have to ask colleagues tomorrow if they saw a significant drop day to day.

But would that also explain the drop in pages per visitor (from 10 to 5)??...












Dimitri

Jeff Kaufman

unread,
Aug 24, 2016, 11:31:20 AM8/24/16
to mod-pagespeed-discuss
I would expect that with defer_js turned off you would see a sharp increase in visitors recorded.  Do you see that?  If so, that would explain the drop in pages per visitor: the hypothesis is that before you were missing visits where people left quickly, and that kind of visit generally had just one page per session.  Since you weren't counting those, you saw higher average pages per second. 

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

in...@dutchcarparts.nl

unread,
Aug 25, 2016, 5:28:01 AM8/25/16
to mod-pagespeed-discuss
Hello Jeff,

Defer js has been off since July 27.
I dont see any sharp increase just the normal weekly fluctuation.













Colleagues also told me that there was a drop in daily orders after the 27th.....

Thanks Dimitri

Jeff Kaufman

unread,
Aug 25, 2016, 9:39:15 AM8/25/16
to mod-pagespeed-discuss
That's very strange!  i'm assuming this is a graph of pageviews?

Are there any other charts in your analytics with a sudden change on the 27th?

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

in...@dutchcarparts.nl

unread,
Aug 25, 2016, 4:46:17 PM8/25/16
to mod-pagespeed-discuss
Hello Jeff,

I thought it was kinda weird!
These were new visitors..... No other charts show sharp fluctuations. Just the two mentioned (bounce rate and pages viewed per session).

Thanks Dimitri
Reply all
Reply to author
Forward
0 new messages