Skip to content

Instantly share code, notes, and snippets.

@thospfuller

thospfuller/pagespeed.conf

Last active Jan 29, 2021
Embed
What would you like to do?
Ubuntu LAMP, WordPress, ModPageSpeed configuration in /etc/apache2/mods-enabled/pagespeed.conf which works with W3 Total Cache and StackPath CDN.
<IfModule pagespeed_module>
<Location /wp-admin/>
ModPagespeed Off
</Location>
ModPagespeed On
ModPagespeedAllow all
ModPagespeedFetchHttps enable
ModPagespeedSslCertDirectory /etc/ssl/certs/
ModPagespeedRewriteLevel CoreFilters
ModPagespeedDomain https://coherentlogic.com
ModPagespeedDomain https://cdn.coherentlogic.com
ModPagespeedPermitIdsForCssCombining *-css
ModPagespeedEnableFilters remove_comments
ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters rewrite_javascript
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters resize_rendered_image_dimensions
ModPagespeedEnableFilters rewrite_domains
ModPagespeedEnableFilters rewrite_images
ModPagespeedEnableFilters convert_jpeg_to_webp
ModPagespeedEnableFilters convert_to_webp_lossless
ModPagespeedEnableFilters convert_to_webp_animated
ModPagespeedEnableFilters recompress_webp
ModPagespeedEnableFilters convert_gif_to_png
ModPagespeedEnableFilters recompress_png
ModPagespeedEnableFilters convert_png_to_jpeg
ModPagespeedEnableFilters convert_jpeg_to_progressive
ModPagespeedEnableFilters recompress_jpeg
ModPagespeedEnableFilters insert_image_dimensions
ModPagespeedEnableFilters inline_images
ModPagespeedEnableFilters inline_google_font_css
ModPagespeedEnableFilters flatten_css_imports
ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters inline_css
ModPagespeedEnableFilters canonicalize_javascript_libraries
ModPagespeedEnableFilters combine_javascript
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters include_js_source_maps
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedEnableFilters lazyload_images
SetOutputFilter DEFLATE
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript application/x-httpd-php
ModPagespeedFileCachePath "/var/cache/mod_pagespeed/"
ModPagespeedFileCacheSizeKb 102400
ModPagespeedFileCacheCleanIntervalMs 3600000
ModPagespeedFileCacheInodeLimit 500000
ModPagespeedLoadFromFileCacheTtlMs 604800000
ModPagespeedMemcachedServers "localhost:11211"
ModPagespeedImageMaxRewritesAtOnce -1
ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 102400
ModPagespeedDefaultSharedMemoryCacheKB 102400
ModPagespeedMapOriginDomain localhost coherentlogic.com
ModPagespeedListOutstandingUrlsOnError on
ModPagespeedStatistics on
ModPagespeedDisallow https://coherentlogic.com/pwa-sw.js
ModPagespeedDisallow https://coherentlogic.com/*.pagespeed.*.js
ModPagespeedDisallow https://coherentlogic.com/pwa-manifest.json
ModPagespeedLoadFromFileRuleMatch disallow .*$
ModPagespeedLoadFromFileRuleMatch allow \.css$
ModPagespeedLoadFromFileRuleMatch allow \.js$
ModPagespeedLoadFromFileRuleMatch allow \.gif$
ModPagespeedLoadFromFileRuleMatch allow \.png$
ModPagespeedLoadFromFileRuleMatch allow \.jpg$
ModPagespeedLoadFromFileRuleMatch allow \.webp$
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment