Pagespeed not resizing images in Carousel to actual size.

130 views
Skip to first unread message

Михаил Дегтярев

unread,
Mar 26, 2018, 5:49:49 AM3/26/18
to mod-pagespeed-discuss
Hi everyone!

I would like Pagespeed to resize and rewrite images to actual displayed size and compress them to WebP format for carousel thumbnails.

Here is webpage which I test:

For thumbnails I use 90% quality JPEG with width equals 650 pixels, and I am waiting that Pagespeed should convert these thumbnails to actual rendered size and recompress them to WebP format, but it does't.

Here is my config:

<IfModule pagespeed_module>
    
    ModPagespeed on

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml



ModPagespeedEnableFilters rewrite_javascript,rewrite_css
ModPagespeedEnableFilters responsive_images,responsive_images_zoom,rewrite_images
ModPagespeedEnableFilters collapse_whitespace,elide_attributes
ModPagespeedEnableFilters trim_urls
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters remove_comments

#CONVERSION JPEG TO WebP Parameters
ModPagespeedEnableFilters convert_jpeg_to_webp
ModPagespeedWebpQualityForSaveData 85
ModPagespeedWebpRecompressionQualityForSmallScreens 50


ModPagespeedEnableFilters resize_rendered_image_dimensions
ModPagespeedEnableFilters lazyload_images

ModPagespeedFinderPropertiesCacheExpirationTimeMs 5259600000

ModPagespeedUrlValuedAttribute a href image

ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters hint_preload_subresources
ModPagespeedEnableFilters inline_preview_images
ModPagespeedEnableFilters resize_mobile_images
ModPagespeedEnableFilters flatten_css_imports
ModPagespeedEnableFilters inline_css
ModPagespeedEnableFilters prioritize_critical_css
ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters combine_css,combine_javascript
ModPagespeedEnableFilters move_css_above_scripts

ModPagespeedDomain www.hwp.ru
   ModPagespeedFileCacheSizeKb          60240000
    ModPagespeedFileCacheCleanIntervalMs 86400000
    ModPagespeedLRUCacheKbPerProcess     1024
    ModPagespeedLRUCacheByteLimit        16384
   
ModPagespeedFileCacheInodeLimit        5000000
ModPagespeedImageMaxRewritesAtOnce      2
ModPagespeedRewriteRandomDropPercentage 90
ModPagespeedImageRecompressionQuality 85
ModPagespeedJpegRecompressionQuality -1
ModPagespeedJpegRecompressionQualityForSmallScreens 70
    #
    # WebP recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
    ModPagespeedWebpRecompressionQuality 85
    ModPagespeedWebpRecompressionQualityForSmallScreens 70
    ModPagespeedImageLimitOptimizedPercent 90
    ModPagespeedImageLimitResizeAreaPercent 90

    ModPagespeedStatistics off
    <Location /pagespeed_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler pagespeed_admin
    </Location>
    <Location /pagespeed_global_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler pagespeed_global_admin
    </Location>

    ModPagespeedStatisticsLogging on
</IfModule>


What should I do to make it rewrite all images?

Thank you!

Longinos

unread,
Mar 26, 2018, 6:36:32 AM3/26/18
to mod-pagespeed-discuss
Hi
I´m not sure if this must work, but I thing the images are not rewrited because are in a non standar tag thus pagepeed does not recognize that.
You have this in your html
<a href="Motherboards/Asrock_x399_fatality/images/xAsrock_x399_fatality_pro_gaming_1.jpg.pagespeed.ic.WPx2fLKBm8.webp" data-thumb="https://www.hwp.ru/Motherboards/Asrock_x399_fatality/images/Asrock_x399_fatality_pro_gaming_1sm.jpg"></a>

As you can see 1 image irl is rewrited but not the other, enclosed in the tag
data-thumb="..... and I thing that these not rewrited is the image used.

You can try some like that in your config

ModPagespeedUrlValuedAttribute ELEMENT ATTRIBUTE CATEGORY

ModPagespeedUrlValuedAttribute a data-thumb image


Longinos

unread,
Mar 26, 2018, 6:48:43 AM3/26/18
to mod-pagespeed-discuss
More on this.
You has non cacheable resources and thus these are not rewrited by pagespeed.
href="bitrix/cache/css/03/konstrukt_page/page_3524f97c0a57f3b3dd715f972f233d7e/page_3524f97c0a57f3b3dd715f972f233d7e_d232f7ecbe6cfa5e4f52ae27bb7d76a7.css?1521376178252" type="text/css" rel="stylesheet"/><!--Uncacheable content, preventing rewriting of https://hwp.ru/bitrix/cache/css/03/konstrukt_page/page_3524f97c0a57f3b3dd715f972f233d7e/page_3524f97c0a57f3b3dd715f972f233d7e_d232f7ecbe6cfa5e4f52ae27bb7d76a7.css?1521376178252-->

You can view these debug messages with https://www.hwp.ru/untitled.php?PageSpeedFilters=+debug , this take some hits to show all debug messages because you can see some transient messages about deadline, resources that can´t be altered because the time to do the work is sort, nothing about this is only a informational message.


Longinos

unread,
Mar 26, 2018, 6:55:05 AM3/26/18
to mod-pagespeed-discuss
More on this.

After some more hit with the debug filter enabled, I get these message in the images

<a href="https://www.hwp.ru/Motherboards/Asrock_x399_fatality/images/Asrock_x399_fatality_pro_gaming_0.jpg"></a><!--The preceding resource was not rewritten because its domain (www.hwp.ru) is not authorized-->

Well, you have
ModPagespeedDomain www.hwp.ru , and for pagespeed these param is only http://www.hwp.ru and you are using https://www.hwp.ru. You need to use some like this:

 
ModPagespeedDomain http*://*.hwp.ru

this cover http and https and all the subdomais of hwp.ru

Михаил Дегтярев

unread,
Mar 26, 2018, 7:06:32 AM3/26/18
to mod-pagespeed-discuss
I added
ModPagespeedUrlValuedAttribute a data-thumb image

to config file and it makes no changes

Михаил Дегтярев

unread,
Mar 26, 2018, 7:31:05 AM3/26/18
to mod-pagespeed-discuss
I changed ModpagespeedDomain to http*://www.hwp.ru as you recommended.
i changed third image to simple IMG SRC code:
<img src="https://www.hwp.ru/Motherboards/Asrock_x399_fatality/images/Asrock_x399_fatality_pro_gaming_2sm.jpg">

Maybe Pagespeed can't rewrite img src because Carousel loads from CDN?



понедельник, 26 марта 2018 г., 14:06:32 UTC+3 пользователь Михаил Дегтярев написал:

Михаил Дегтярев

unread,
Mar 26, 2018, 7:55:24 AM3/26/18
to mod-pagespeed-discuss
Ok, can you look please at this page?
https://www.hwp.ru/articles/Digma_LINX_A453_3G__96_eshche_odin_byudzhetnik_147670/?PageSpeedFilters=+debug

First image:

<img src="/Satellite/Digma_A453_3G/images/Digma A453 3G_1sm.jpg" border="0" width="650" height="1134" data-pagespeed-url-hash="1051896732" data-pagespeed-onload="pagespeed.CriticalImages.checkImageForCriticality(this);" onload="var elem=this;if (this==window) elem=document.body;elem.setAttribute('data-pagespeed-loaded', 1)" data-pagespeed-loaded="1">

In HTML code we have relative source for image, and as I see, it is also not rewriting.
Maybe Pagespeed misconfigured and not rewrite images at all?

понедельник, 26 марта 2018 г., 13:55:05 UTC+3 пользователь Longinos написал:

Longinos

unread,
Mar 26, 2018, 12:49:09 PM3/26/18
to mod-pagespeed-discuss
I don´t see these image in this page but I see other that are converted to webp format like this

<p style="text-align: center;"><a href="/Satellite/Digma_A453_3G/images/xDigma,P20A453,P203G_1.jpg.pagespeed.ic.kcOGbLqyi0.webp" target="_blank"><img src="/Satellite/Digma_A453_3G/images/xDigma,P20A453,P203G_1sm.jpg.pagespeed.ic.lPuHdSI4u4.webp" border="0" width="650" height="1134"

And see many css, js and images are inlined, thus pagespeed is working, I think.
In developers tools from chrome I see all the images are webp or are not from your domain, css files the same. Js files are rewritten unless they are from other domains or are unsafe to change, these shoe this message

<!--This script contains introspective JavaScript and is unsafe to replace.-->

Михаил Дегтярев

unread,
Mar 27, 2018, 3:15:29 AM3/27/18
to mod-pagespeed-discuss
I find main reason why it did't worked - I disabled next filters:
#ModPagespeedEnableFilters inline_preview_images
#ModPagespeedEnableFilters resize_mobile_images
# ModPagespeedImageMaxRewritesAtOnce      2
 #ModPagespeedRewriteRandomDropPercentage 90
 #ModPagespeedImageLimitResizeAreaPercent 90

And now it works.

I still not see any profit of
ModPagespeedEnableFilters resize_rendered_image_dimensions
I think, it don't work as described.
I upload 1650x900 picture and open it in Iphone 5 mode in Google Chrome Developer Tools.
It loads web.p optimized picture, but this picture is not 250x170 pixels as I expected.




понедельник, 26 марта 2018 г., 19:49:09 UTC+3 пользователь Longinos написал:

Longinos

unread,
Mar 27, 2018, 6:31:41 AM3/27/18
to mod-pagespeed-discuss

Hi again
I can see many php files that pagespeed can´t optimize. Perhaps you need to add

ModPagespeedDisallow *.php

to your config files


Михаил Дегтярев

unread,
Mar 27, 2018, 4:43:20 PM3/27/18
to mod-pagespeed-discuss
Thank you.
After my last config change, Pagespeed begun to index 150k+ pages per day, and I don't know how to stop it. It eats all RAM of database server.

вторник, 27 марта 2018 г., 13:31:41 UTC+3 пользователь Longinos написал:

Михаил Дегтярев

unread,
Mar 27, 2018, 4:46:30 PM3/27/18
to mod-pagespeed-discuss
By the way, how can you read statistic of Pagespeed from our webserver? Is it any params?


вторник, 27 марта 2018 г., 13:31:41 UTC+3 пользователь Longinos написал:

Otto van der Schaaf

unread,
Mar 27, 2018, 5:39:13 PM3/27/18
to mod-pagesp...@googlegroups.com
You can monitor statistics in the admin interface: 

Otto

--
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/c5a74cf6-2342-4348-ba63-d6fac38302e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages