Modpagespeed messing up page images

45 views
Skip to first unread message

Alexander Gran

unread,
Feb 18, 2021, 6:14:28 AMFeb 18
to mod-pagesp...@googlegroups.com

Hi,


I have a page, https://www.bobbie.de/deal_slv_test , that sometimes is messed up by mod pagespeed.


Not sure what is really going on, I see two issues:


A.) Some images get added to the the body, which shouldn't happen (breaks visual and I can't see why they should be there):



See all those img tags directly below <body>, you see one image hovering over the content "SIE SIND ALS...".



B.) The algolia code on the page is runnig into an error:

Uncaught TypeError: Cannot read property 'length' of undefined

    at Object.e.scan (algoliaBundle.min.js:1)

    at Object.e.compile (algoliaBundle.min.js:1)

    at HTMLDocument.eval (eval at <anonymous> (deal_slv_test:1), <anonymous>:1:245)

    at c (algoliaBundle.min.js:1)

    at Object.fireWith [as resolveWith] (algoliaBundle.min.js:1)

    at Function.ready (algoliaBundle.min.js:1)

    at HTMLDocument.l (algoliaBundle.min.js:1)


When I disable mod_pagespeed, this works just fine. Also when reloading the page, it sometimes works ok.

I haven't spotted that effect on other pages of the website, so I guess it is something special to this one. Can't see what that should be, though.


Any Idea how to debug that? Can I breakpoint in chrome to see which code is adding those img?


Regards

Alex


--

bobbie Deutschland GmbH

Kasinostraße 44 52066 Aachen

Geschäftsführer

T: +49 89 2154015-11

M: +49 1755830772

al...@bobbie.de


Treffen Sie bobbie jederzeit in einer Videokonferenz. Zu gegebener Zeit auch wieder auf den relevanten Messen.

bobbie Deutschland GmbH    Wilhelm-Dieß-Weg 2    81927 München
Büro München:    Leopoldstraße 7    80802 München    Eingang Georgenstraße
Büro Aachen:  Kasinostraße 44    52066 Aachen

Geschäftsführer: Tim Kuhlmann; Dipl.-Inform. Alexander Gran MBA; Dipl.-Ing. Stephan Langkau MBA

Amtsgericht München HRB 233452     Ust.-ID-Nr. DE311909262
Bild

Joshua Marantz

unread,
Feb 18, 2021, 8:00:08 AMFeb 18
to mod-pagespeed-discuss
Which filters do you have enabled?

--
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/3047718.b6tAokP5S5%40alex14.bobbie.de.

Alexander Gran

unread,
Feb 18, 2021, 8:02:19 AMFeb 18
to mod-pagespeed-discuss, 'Joshua Marantz' via mod-pagespeed-discuss

Hi Joshua,


   # core filters 
pagespeed EnableFilters add_head;
pagespeed EnableFilters remove_quotes;
pagespeed EnableFilters combine_css;
pagespeed EnableFilters combine_javascript; pagespeed EnableFilters rewrite_images;                                                                                                                          

   # extra 
pagespeed EnableFilters sprite_images;
pagespeed EnableFilters collapse_whitespace;
pagespeed EnableFilters dedup_inlined_images;
pagespeed EnableFilters inline_preview_images,resize_mobile_images;
pagespeed EnableFilters lazyload_images;
pagespeed EnableFilters rewrite_javascript;
pagespeed EnableFilters responsive_images,resize_images;
# CSS Minification 
pagespeed EnableFilters rewrite_css,flatten_css_imports,inline_import_to_link,inline_css,move_css_above_scripts,move_css_to_head,outline_css,prioritize_critical
_css,inline_google_font_css;

pagespeed EnableFilters rewrite_images,recompress_images,dedup_inlined_images; # Convert images 
pagespeed EnableFilters convert_png_to_jpeg,convert_jpeg_to_webp,convert_to_webp_animated,recompress_webp; # Recompress 
pagespeed EnableFilters recompress_jpeg,recompress_png,recompress_webp; # Strip Image 
pagespeed EnableFilters strip_image_color_profile,strip_image_meta_data,jpeg_subsampling; # Resize Images 
pagespeed ImageRecompressionQuality 80;                                                                                                                          
pagespeed JpegRecompressionQualityForSmallScreens 70;
pagespeed ImageLimitOptimizedPercent 99;
pagespeed ImageLimitResizeAreaPercent 95;
# Cache 
pagespeed EnableFilters insert_dns_prefetch;
pagespeed EnableFilters extend_cache,extend_cache_css,extend_cache_images,extend_cache_scripts,extend_cache_pdfs;
pagespeed EnableFilters local_storage_cache;
pagespeed UrlValuedAttribute img data-zoom-image image;
pagespeed UrlValuedAttribute img data-lazy image;

pagespeed FetchHttps enable;


regards

Alex


--

bobbie Deutschland GmbH

Kasinostraße 44 52066 Aachen

Geschäftsführer

T: +49 89 2154015-11

M: +49 1755830772

al...@bobbie.de

Am Donnerstag, 18. Februar 2021, 13:59:49 CET schrieb 'Joshua Marantz' via mod-pagespeed-discuss:

> Which filters do you have enabled?

>

> On Thu, Feb 18, 2021, 6:14 AM 'Alexander Gran' via mod-pagespeed-discuss <

>

> mod-pagesp...@googlegroups.com> wrote:

> > Hi,

> >

> > I have a page, https://www.bobbie.de/deal_slv_test , that sometimes is

> > messed up by mod pagespeed.

> >

> > Not sure what is really going on, I see two issues:

> >

> > A.) Some images get added to the the body, which shouldn't happen (breaks

> > visual and I can't see why they should be there):

> >

> >

> >

> > See all those img tags directly below <body>, you see one image hovering

> > ------------------------------

> >

> > bobbie Deutschland GmbH    Wilhelm-Dieß-Weg 2    81927 München

> > Büro München:    Leopoldstraße 7    80802 München    Eingang Georgenstraße

> > Büro Aachen:  Kasinostraße 44    52066 Aachen

> > ------------------------------

> > Geschäftsführer: Tim Kuhlmann; Dipl.-Inform. Alexander Gran MBA;

> > Dipl.-Ing. Stephan Langkau MBA

> >

> > Amtsgericht München HRB 233452     Ust.-ID-Nr. DE311909262

> >

> > --

> > 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/3047718.b6tAokP5S5

> > %40alex14.bobbie.de

Joshua Marantz

unread,
Feb 18, 2021, 8:33:26 AMFeb 18
to mod-pagespeed-discuss
Some of the filters you have enabled may interact poorly with JavaScript on your page. A few that come to mind are:

move_css_above_scripts,move_css_to_head,outline_css,prioritize_critical_css

You could start by disabling those 3, then add them back one at a time to see which one is the culprit. You could repeat that also for your other filters, but those come mind. The ones I'm most suspicious of are the move* ones. For example, the doc in https://www.modpagespeed.com/doc/filter-css-above-scripts says:

This filter is considered low risk. However, JavaScript that is executed before a CSS element will see a different view of the DOM in the presence of this rewriter: the CSS element will now be in the head. If there is such JavaScript embedded in the middle of a page then this rewriter may change its behavior.

Alexander Gran

unread,
Feb 22, 2021, 3:57:41 AMFeb 22
to mod-pagespeed-discuss, 'Joshua Marantz' via mod-pagespeed-discuss

Hi Joshua,


Thanks. I've tried that, but it didn't help.

However while tracking down the bug, I came closer to something:

My page loads various stuff via requirejs. One of the things loaded are hogan templates for aloglia search. It is loaded by https://www.bobbie.de/static/version1613755810/frontend/Bobbie/Theme/de_DE/Bobbie_CustomAlgolia/js/search.js 

(version number may vary)

on the very top, and appended to the body, creatig some <script "text/template"> entries.

All good so far, algolia will load those later.

Now pagespeed image inliner starts to wipe them out again:

And replaceLastScript then:


Not sure where the assumption comes from that you could swap out the last script of the document? In my case thats one of my templates, but could be anything I think.


Using -inline_images,-delay_images,-lazyload_images,-local_storage_cache seems to fix the issue.



Regards

Alex



--

bobbie Deutschland GmbH

Kasinostraße 44 52066 Aachen

Geschäftsführer

T: +49 89 2154015-11

M: +49 1755830772

al...@bobbie.de

> > T: +49 89 2154015-11 <+49%2089%20215401511>

> >

> > M: +49 1755830772 <+49%20175%205830772>

> > > > T: +49 89 2154015-11 <+49%2089%20215401511>

> > > >

> > > >

> > > >

> > > > M: +49 1755830772 <+49%20175%205830772>

Bild
Bild1
Reply all
Reply to author
Forward
0 new messages