Lazyload images with URL not ending in image extension?

57 views
Skip to first unread message

Amin Sabet

unread,
Nov 9, 2016, 12:40:31 PM11/9/16
to ngx-pagespeed-discuss
My website has images in this format:


It seems that ngx_pagespeed doesn't recognize this as an image because it doesn't end in jpg.

Therefore, the lazy load filter does not work.

Is there any way for me to get ngx_pagespeed to recognize this as an image and lazy load?

Thanks,
Amin

Joshua Marantz

unread,
Nov 9, 2016, 12:48:25 PM11/9/16
to ngx-pagesp...@googlegroups.com
It's uncommon that your image ends in a "/".  However I don't see why this should be a problem.  Can you provide the URL to the HTML where this image is instantiated?

-Josh

--
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-discuss+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

Amin Sabet

unread,
Nov 9, 2016, 12:51:25 PM11/9/16
to ngx-pagespeed-discuss
Sorry, please disregard.  I think Otto already answered this question from me before.  I will go back and re-read that.

Amin Sabet

unread,
Nov 9, 2016, 1:27:38 PM11/9/16
to ngx-pagespeed-discuss
Hi Josh,

I tried making the changes Otto suggested, and still the images don't seem to be registering.

I am getting for example:

<img src="https://cdn.mu-43.com/attachments/30186918264_cf6f48ca2d_b-jpg.488441/" title="30186918264_cf6f48ca2d_b." alt="30186918264_cf6f48ca2d_b." class="bbCodeImage LbImage" data-pagespeed-url-hash="209611310" onload="pagespeed.CriticalImages.checkImageForCriticality(this);"/><!--4xx status code, preventing rewriting of https://cdn.mu-43.com/attachments/30186918264_cf6f48ca2d_b-jpg.488441/--><!--4xx status code, preventing rewriting of https://cdn.mu-43.com/attachments/30186918264_cf6f48ca2d_b-jpg.488441/-->

on this page:

Joshua Marantz

unread,
Nov 9, 2016, 1:40:52 PM11/9/16
to ngx-pagesp...@googlegroups.com
I think there might be several different issues, or some combination of them.
  • The lazyload images filter by default relies on beacons, and will not lazy-load any image that's above the fold.  That image is above the fold on my screen.  You can disable this with:
  • pagespeed CriticalImagesBeaconEnabled false;
  • The image can't be fetched by the ngx_pagespeed server, probably because of a DNS issue of some sort on your system, or maybe HTTPS isn't configured yet.  However that shouldn't matter as lazyload_images does not actually need to read the image content into the server.  That does affect other image optimization however.
  • You are also including some filters with overlapping functionality (resize mobile images).  I think this is probaby not the issue
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsubscri...@googlegroups.com.

--
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-discuss+unsubscri...@googlegroups.com.

Amin Sabet

unread,
Nov 9, 2016, 2:50:54 PM11/9/16
to ngx-pagespeed-discuss
I added these:

pagespeed LazyloadImagesAfterOnload off;
pagespeed CriticalImagesBeaconEnabled false;


and removed resize mobile images.

HTTPS is configured, and I am not aware of any DNS issue.

As far as I can tell, the issue is unaffected.  Still no images lazy loading.

Could it be related to the way the image address is rewritten?  I think my forum software is rewriting the image URL.

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
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-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Nov 9, 2016, 4:42:26 PM11/9/16
to ngx-pagesp...@googlegroups.com
Have you restarted your server since you edited the pagespeed.conf file?  Visiting view-source:https://www.mu-43.com/threads/london-live-comp.87791/?PageSpeedFilters=+debug indicates that the changes you've made haven't taken effect yet.

This is the snippet from the 'debug' output that made me think HTTPS is not set up, or there are DNS issues on your site.  Basically, PageSpeed attempts to perform an HTTPS fetch of your CDN-hosted image from the nginx server, and fails, hence this message:

You are clearly getting some other images optimized, so PageSpeed is generally working on your site, but not for this image.

What forum software are you using, and when does it rewrite image URLs?  Does it run downstream of PageSpeed or upstream?  Would it be possible to temporarily disable related features in the forum software to see if that's the issue?

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsubscri...@googlegroups.com.

--
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-discuss+unsubscri...@googlegroups.com.

--
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-discuss+unsubscri...@googlegroups.com.

Longinos

unread,
Nov 11, 2016, 3:07:50 AM11/11/16
to ngx-pagespeed-discuss
Sorry for the meddling. Some clue on this

<img src="https://cdn.mu-43.com/attachments/30186922824_ce3a922ee6_b-jpg.488440/" title="30186922824_ce3a922ee6_b." alt="30186922824_ce3a922ee6_b." class="bbCodeImage LbImage"/><!--The preceding resource was not rewritten because its domain (cdn.mu-43.com) is not authorized-->

from https://www.mu-43.com/threads/london-live-comp.87791/?PageSpeedFilters=+debug
Reply all
Reply to author
Forward
0 new messages