Get the most out of your Centmin Mod LEMP stack
Become a Member

PageSpeed How to disable webP

Discussion in 'Web Development & Web Performance' started by Jon Snow, Sep 17, 2020 at 6:44 AM.

  1. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I haven't done any of this - Nginx Serving WebP Images Conditionally Demo

    The webp include isn't in the nginx vhost context.

    But images are webp. Some are broken from time to time, so I want to continue using Nginx PageSpeed but disable webP support as I don't need it.

    How can this be done?
     
  2. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I also don't use Cloudflare's pro plan that has the option for webp support.

    Images get the webp extension.
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    9:47 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  4. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
  5. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    9:47 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    both links point to same post for me. Did you change the option of how many posts per thread page you want to view ?

    link to an example page with webP images ?
     
  6. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    It points to different posts for me. I wasn't even aware users could change that setting, but that's still a huge gap between pages - page 9 and page 17. Maybe it depends on the browser.
    I'll PM the link to the site.
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    9:47 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Generally browser shouldn't - strange indeed
    add ngx_pagespeed debug query string ?PageSpeedFilters=+debug to inspect your source code of your page will show you which ngx_pagespeed filters are enabled

    for your site webP conversion filter is still enabled for
    Code (Text):
    jw    Convert Jpeg To Webp

    Code (Text):
    <!--
    mod_pagespeed on
    Filters:
    ah    Add Head
    cc    Combine Css
    jc    Combine Javascript
    gp    Convert Gif to Png
    jp    Convert Jpeg to Progressive
    jw    Convert Jpeg To Webp
    mc    Convert Meta Tags
    pj    Convert Png to Jpeg
    ws    When converting images to WebP, prefer lossless conversions
    db    Debug
    ec    Cache Extend Css
    ei    Cache Extend Images
    es    Cache Extend Scripts
    fc    Fallback Rewrite Css
    if    Flatten CSS Imports
    hw    Flushes html
    ci    Inline Css
    ii    Inline Images
    il    Inline @import to Link
    ji    Inline Javascript
    js    Jpeg Subsampling
    rj    Recompress Jpeg
    rp    Recompress Png
    rw    Recompress Webp
    ri    Resize Images
    cf    Rewrite Css
    jm    Rewrite External Javascript
    jj    Rewrite Inline Javascript
    cu    Rewrite Style Attributes With Url
    cp    Strip Image Color Profiles
    md    Strip Image Meta Data
    
    Options:
    AvoidRenamingIntrospectiveJavascript (aris) True
    EnableRewriting (e) 1
    FileCacheInodeLimit (afcl) 500000
    RewriteLevel (l) Core Filters
    
    #NumFlushes            0
    #EndDocument after     4706us
    #Total Parse duration  3929us
    #Total Render duration 10139us
    #Total Idle duration   777us
    No critical images detected.
    The following filters were disabled for this request:
        SupportNoscript
    -->
     
  8. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Is there anything that would enable it? I'm not sure why it's ON.

    This is the pagespeed config:

    Code (Text):
    pagespeed on;
    
    #######################################################
    # Purge nginx pagespeed cache
    # https://developers.google.com/speed/pagespeed/module/system#flush_cache
    #######################################################
    pagespeed EnableCachePurge on;
    pagespeed PurgeMethod PURGE;
    
    #######################################################
    # File cache settings 
    ######################################
    # needs to exist and be writable by nginx
    
    # pagespeed FileCacheSizeKb          102400;
    # pagespeed FileCacheCleanIntervalMs 3600000;
    # pagespeed FileCacheInodeLimit      500000;
    
    #######################################################
    # By default, ngx_pagespeed adds an X-PageSpeed header with a value of the version of 
    # ngx_pagespeed being used. This directive lets you specify the value to use instead:
    # pagespeed XHeaderValue "ngx_pagespeed";
    
    #######################################################
    # let's speed up PageSpeed by storing it in the super duper fast memcached
    # Ensure Memcached server installed http://centminmod.com/memcached.html
    # default install for centmin mod is on port 11211, so localhost:11211 is correct
    # uncomment - remove hash # in front of below 2 lines to enable
    # timeout set at 100 milliseconds
    #  pagespeed MemcachedThreads 1;
    #  pagespeed MemcachedServers "localhost:11211";
    #  pagespeed MemcachedTimeoutUs 100000;
    
    #######################################################
    ## 1.11.33.0 beta save-data
    ######################################
    # https://developers.google.com/speed/pagespeed/module/filter-image-optimize#image-quality
    
    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#JpegQualityForSaveData
    pagespeed JpegQualityForSaveData 50;
    
    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#WebpQualityForSaveData
    pagespeed WebpQualityForSaveData 50;
    
    #######################################################
    ## 1.7.30.1 beta defaults
    ######################################
    pagespeed PreserveUrlRelativity on;
    pagespeed MaxCombinedCssBytes -1;
    pagespeed ImageResolutionLimitBytes 16777216;
    # pagespeed EnableFilters inline_google_font_css;
    
    #######################################################
    ## 1.6.29.3 beta defaults
    ######################################
    pagespeed AvoidRenamingIntrospectiveJavascript on;
    pagespeed ImageInlineMaxBytes 3072;
    pagespeed CssImageInlineMaxBytes 0;
    pagespeed MaxInlinedPreviewImagesIndex -1;
    pagespeed MinImageSizeLowResolutionBytes 3072;
    
    #######################################################
    ## ngx_pagespeed filters settings below ##
    ######################################
    
      # show half the users an optimized site, half the regular site
      # change UA-XXXXXXXXXX-1 to your GA unique id
      # uncomment - remove hash # in front of below 5 lines to enable
    #  pagespeed RunExperiment on;
    #  pagespeed AnalyticsID UA-XXXXXXXXXX-1;
    #  pagespeed ExperimentVariable 1;
    #  pagespeed ExperimentSpec "id=1;percent=50;level=CoreFilters;enabled=collapse_whitespace,remove_comments;";
    #  pagespeed ExperimentSpec "id=2;percent=50";
    
      # Filter settings
      # filters outlined at http://ngxpagespeed.com/ngx_pagespeed_example/
      pagespeed RewriteLevel CoreFilters;
      pagespeed EnableFilters collapse_whitespace,remove_comments;
    
      # make_google_analytics_async
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-make-google-analytics-async
    #  pagespeed EnableFilters make_google_analytics_async;
    
      # make_show_ads_async
      # https://developers.google.com/speed/pagespeed/module/filter-make-show-ads-async
    #  pagespeed EnableFilters make_show_ads_async;
    
      # responsive_images, responsive_images_zoom
      # https://developers.google.com/speed/pagespeed/module/filter-image-responsive
    #  pagespeed EnableFilters responsive_images;
    #  pagespeed EnableFilters responsive_images_zoom;
    
      # convert_to_webp_animated
      # https://developers.google.com/speed/pagespeed/module/filter-image-optimize#convert_to_webp_animated
    #  pagespeed EnableFilters convert_to_webp_animated;
    
      # inline_google_font_css
      # https://developers.google.com/speed/pagespeed/module/filter-css-inline-google-fonts
      pagespeed EnableFilters inline_google_font_css;
      # require FetchHttps if using https site
    #   pagespeed FetchHttps enable;
    
      # inline_css
      # https://developers.google.com/speed/pagespeed/module/filter-css-inline
    #   pagespeed EnableFilters inline_css;
    #   pagespeed CssInlineMaxBytes 2048;
    
      # prioritize_critical_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-prioritize-critical-css
    #   pagespeed EnableFilters prioritize_critical_css;
    
      # move_css_to_head
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-to-head
      pagespeed EnableFilters move_css_to_head;
    
      # move_css_above_scripts
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-above-scripts
    #  pagespeed EnableFilters move_css_above_scripts;
    
      # combine_css 
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-combine
    #  pagespeed EnableFilters combine_css;
    
       # Uncomment this if you want to prevent mod_pagespeed from combining files
       # (e.g. CSS files) across paths
       #
    #  pagespeed CombineAcrossPaths off;
    
      # combine_javascript
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-js-combine
    #  pagespeed EnableFilters combine_javascript;
    #  pagespeed MaxCombinedJsBytes 122900;
    
      # extend_cache
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-cache-extend
    #  pagespeed EnableFilters extend_cache;
    
      # rewrite_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-rewrite
    #  pagespeed EnableFilters rewrite_css;
    
      # rewrite_javascript
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-js-minify
    #  pagespeed EnableFilters rewrite_javascript;
    
      # inline_preview_images
      # https://developers.google.com/speed/pagespeed/module/filter-inline-preview-images
      pagespeed EnableFilters inline_preview_images;
    
      # lazyload_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-lazyload-images
    #  pagespeed EnableFilters lazyload_images;
    
      # rewrite_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-image-optimize
    #  pagespeed EnableFilters rewrite_images;
       pagespeed DisableFilters rewrite_images;
       pagespeed DisableFilters recompress_images;
       pagespeed DisableFilters convert_png_to_jpeg;
       pagespeed DisableFilters extend_cache_images;
    #  pagespeed EnableFilters convert_png_to_jpeg;
    #  pagespeed EnableFilters convert_jpeg_to_webp;
    #  pagespeed EnableFilters convert_to_webp_lossless;
    
      # sprite_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-image-sprite
    # pagespeed EnableFilters rewrite_css,sprite_images;
    
      # insert_dns_prefetch
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-insert-dns-prefetch
    #  pagespeed EnableFilters insert_dns_prefetch;
    
      # InPlaceResourceOptimization
      # https://developers.google.com/speed/pagespeed/module/system#ipro
      # Enabled by default as of 1.9.32.1
      pagespeed InPlaceResourceOptimization off;
    
    #######################################################
    
     
  9. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    This has always been commented out btw:
    Code (Text):
    #  pagespeed EnableFilters convert_jpeg_to_webp;
    #  pagespeed EnableFilters convert_to_webp_lossless;

    I've never turned it ON.

    One day I noticed broken images and figured out webp was supported, that's why I'm trying to turn it OFF.
     
  10. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    /usr/local/nginx/conf/

    Also has many pagespeed configs but they're all with numbers (seems like backups):

    pagespeed.png
     
  11. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    9:47 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    instead of
    Code (Text):
    #  pagespeed EnableFilters convert_jpeg_to_webp;
    #  pagespeed EnableFilters convert_to_webp_lossless;
    

    try disable filter
    Code (Text):
      pagespeed DisableFilters convert_jpeg_to_webp;
      pagespeed DisableFilters convert_to_webp_lossless;
    
     
  12. Jon Snow

    Jon Snow Active Member

    544
    72
    28
    Jun 30, 2017
    Ratings:
    +117
    Local Time:
    8:47 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Didn't seem to work :( I also restarted nginx.