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

IP.Board IPB Pagespeed Config

Discussion in 'Forum software usage' started by Jimmy, Mar 5, 2018.

  1. Jimmy

    Jimmy Well-Known Member

    1,706
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    9:24 PM
    1.17.x
    MariaDB 10.3.x
    Here is what I have.

    Code:
    #######################################################
    # PAGESPEED CONFIGURATION FILE
    # RESOURCES
    # https://www.keycdn.com/support/pagespeed-cdn/
    # https://www.webfoobar.com/node/79
    #######################################################
    
    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          1048576;
    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 "rok on crazy diamond";
    
    #######################################################
    # 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 60;
    
    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#WebpQualityForSaveData
    pagespeed WebpQualityForSaveData 60;
    
    #######################################################
    ## 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 https://www.modpagespeed.com/doc/config_filters
    # PageSpeed offers three "levels" to simplify configuration: PassThrough, CoreFilters, and OptimizeForBandwidth. The CoreFilters set contains filters that the PageSpeed
    # team believes are safe for most web sites. By using the CoreFilters set, as PageSpeed is updated with new filters, your site will get faster. The OptimizeForBandwidth
    # setting provides a stronger guarantee of safety and is suitable as a default setting for use with sites that are not aware of PageSpeed.
    pagespeed RewriteLevel PassThrough;
    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,resize_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 EnableFilters convert_jpeg_to_progressive;
    # pagespeed EnableFilters convert_jpeg_to_webp;
    # pagespeed EnableFilters convert_to_webp_lossless;
    # pagespeed EnableFilters inline_images;
    # pagespeed EnableFilters recompress_images;
    # pagespeed EnableFilters extend_cache_images;
    
    # Recompress Images Group
    # This is a filter group consisting of convert_gif_to_png, convert_jpeg_to_progressive, convert_jpeg_to_webp, convert_png_to_jpeg,
    # jpeg_subsampling, recompress_jpeg, recompress_png, recompress_webp, strip_image_color_profile, and strip_image_meta_data.
    pagespeed EnableFilters recompress_images;
    
    # Rewrite Images Group
    # This is a filter group that includes inline_images, recompress_images, convert_to_webp_lossless, and resize_images.
    pagespeed EnableFilters rewrite_images;
    
    # 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;
    
    # Enable rewrite_domains when using CDN.
    # Information on Origin Pull CDNs
    # https://www.webfoobar.com/node/79
    pagespeed EnableFilters rewrite_domains;
    
    # DOMAIN1.COM INFO
    pagespeed Domain https://domain1.com;
    pagespeed MapRewriteDomain https://cdn.domain1.com https://domain1.com;
    
    # DOMAIN2.COM INFO
    pagespeed Domain https://domain2.com;
    pagespeed MapRewriteDomain https://cdn.domain2.com https://domain2.com;
    
    # DOMAIN3.COM INFO
    pagespeed Domain https://domain3.com;
    pagespeed MapRewriteDomain https://cdn.domain3.com https://domain3.com;
    
    # BLOCKED LOCATIONS
    pagespeed Disallow  "*/page/index.html";
    pagespeed Disallow  "*do=quote*";
    pagespeed Disallow  "*/admin/*";
    
    # REAL IPS ADMIN LOCATIONS
    pagespeed Disallow  "*/<read_admin_folder1>/*";
    pagespeed Disallow  "*/<read_admin_folder2>/*";
    pagespeed Disallow  "*/<read_admin_folder3>/*";
    
    # IPS IMAGE PROXY
    pagespeed Disallow  "*/imageproxy/imageproxy.php*";
    
    
    #######################################################
    
    
     
  2. Jimmy

    Jimmy Well-Known Member

    1,706
    365
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +923
    Local Time:
    9:24 PM
    1.17.x
    MariaDB 10.3.x
    @eva2000 was there an issue with having InPlaceResourceOptimization = on (the default state). CMM pagespeed.conf file has InPlaceResourceOptimization = off. I was curious what led you to turn it off.
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,459
    10,315
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,000
    Local Time:
    11:24 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Don't recall the specifics, but early on there were issues with IPRO enabled.