Skip to content

Instantly share code, notes, and snippets.

@shabarin
Last active May 13, 2017 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shabarin/a32212ae12b05e91bbeee57aedb36d9f to your computer and use it in GitHub Desktop.
Save shabarin/a32212ae12b05e91bbeee57aedb36d9f to your computer and use it in GitHub Desktop.
pagespeedngx
#server {
#...
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
pagespeed StatisticsPath /ngx_pagespeed_statistics;
pagespeed MessagesPath /ngx_pagespeed_message;
pagespeed ConsolePath /pagespeed_console;
pagespeed AdminPath /pagespeed_admin;
pagespeed EnableFilters trim_urls;
pagespeed EnableFilters resize_rendered_image_dimensions;
pagespeed EnableFilters rewrite_css;
#
pagespeed RewriteRandomDropPercentage 0;
pagespeed FileCacheSizeKb 102400;
pagespeed FileCacheCleanIntervalMs 3600000;
pagespeed FileCacheInodeLimit 500000;
pagespeed RewriteDeadlinePerFlushMs 50;
pagespeed EnableCachePurge off;
pagespeed CacheFlushFilename cache.flush;
pagespeed CacheFlushPollIntervalSec 1;
pagespeed FetchHttps enable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment