Note that there are some explanatory texts on larger screens.

plurals
  1. POngx_pagespeed - Gzip static assets
    text
    copied!<p>I am trying to find the best approach for my nginx box. My goal is, of course, the best possible performance, and the best loading times for my users.</p> <p>So I was load testing my nginx and - with the help of maxim-dounin from nginx forums - found out that my throughput problems was on the fly gzipping of static assets.</p> <p>I'll have to pre-gzip everything on the build process, thats very easy - and do on the fly gzip for dynamic content only with comp level @ 1 or 2, that shoud save some cpu and allow me to serve as many users as possible with aws m1.small ec2 instance.</p> <p>But I also intent to use ngx_pagespeed to optimize these static assets, minify, combine, stuff that ngx_pagespeed does so well. I mean, images I can work around and do jpgoptim and pngoptim on build process, but combining css/js is harder.</p> <p>I am using these ngx_pagespeed config:</p> <pre><code>pagespeed on; pagespeed EnableFilters combine_css,combine_javascript,canonicalize_javascript_libraries,collapse_whitespace,convert_meta_tags,dedup_inlined_images,flatten_css_imports,inline_import_to_link,inline_css,inline_javascript,rewrite_javascript,remove_comments,rewrite_css,rewrite_images,convert_gif_to_png,recompress_png,convert_jpeg_to_progressive,strip_image_color_profile,strip_image_meta_data,insert_image_dimensions; pagespeed JpegRecompressionQuality 80; pagespeed FileCacheSizeKb 256000; #256mb pagespeed FileCacheCleanIntervalMs 3600000; pagespeed FileCacheInodeLimit 500000; pagespeed FileCachePath /run/shm/nginx/pagespeed_cache; pagespeed Statistics on; pagespeed StatisticsLogging on; pagespeed LogDir /var/log/pagespeed; pagespeed LowercaseHtmlNames on; </code></pre> <p>Any ideias on how ngx_pagespeed works with nginx gzip_static? I mean, as far as my understaing go, ngx_pagespeed is running 'in front' of nginx, as it caches everything it optimizes to tmpfs. If the server got a hit for a already optimized asset it servers from tmpfs, and I looked for gzipped files on the cache folder and could not find any. First of all, ngx_pagespeed does its own gzipping? It does it on the fly or it cache gzipped version?</p> <p>How does it go when it receives an already gzipped asset from nginx (gzip_static on)? Does it have to unzip and then gzip again after optimization?</p> <p>How can I have the best of both worlds - serving pre-compressed static assets and ngx_pagespeed optimizations?</p> <p>Thanks alot and best regards.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload