ImagePreserveURLs not working

10 views
Skip to first unread message

rama sesha rao Kankatala

unread,
Nov 3, 2022, 6:25:40 AM11/3/22
to ngx-pagespeed-discuss
Hi Team,

Need your help in preserving image name.

Requirement 

Converting png, jpg, jpeg to webp without name change.

We don't want .pagespeed or random string to image name.
Original Image name: orange.jpg
Expected Image name(webp format): orange.jpg or orange.jpg.webp or orange.webp 
Actual Image name:
orange.jpg.pagespeed.ic.sm9VxqLamn.webp

Below is my config

server {
 pagespeed on;
pagespeed RewriteLevel PassThrough;
pagespeed EnableCachePurge on;
pagespeed PurgeMethod PURGE;
pagespeed RewriteLevel OptimizeForBandwidth;
 pagespeed EnableFilters convert_png_to_jpeg;
  pagespeed EnableFilters convert_jpeg_to_webp;
pagespeed ImagePreserveURLs true;
pagespeed DisableFilters inline_images,combine_css,combine_javascript,extend_cache_scripts,extend_cache_css,flatten_css_imports,resize_images;
pagespeed ForbidAllDisabledFilters true;
    pagespeed FileCachePath "/var/cache/ngx_pagespeed_678/";
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir /var/log/pagespeed;
pagespeed AdminPath /pagespeed_admin;
pagespeed FetchHttps enable;
location ~ ^/pagespeed_admin {
}

        listen 80 default_server;
        listen [::]:80 default_server;
 root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;
      }



Longinos

unread,
Nov 13, 2022, 8:32:51 AM11/13/22
to ngx-pagespeed-discuss
Hi
>> Converting png, jpg, jpeg to webp without name change.
That not feasible, if you convert to webp format from jpg,png, the name must include some pagespeed stuff.
If you preserve url some optimizations are done (like resize the image or change the image quality), but not image conversions.

Joshua Marantz

unread,
Nov 13, 2022, 9:41:34 AM11/13/22
to ngx-pagesp...@googlegroups.com
I think actually OptimizeForBandwidth includes converting jpeg to webp. See the table at the bottom of https://www.modpagespeed.com/doc/config_filters and the row for convert_jpeg_to_webp.

The ".jpeg" extension is not actually the critical determinant -- it's the content-type returned in response headers. Please give OptimizeForBandwidth level a try!


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ngx-pagespeed-discuss/52dcb08f-9833-43eb-a42a-bf494ffdb65dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages