Problem when try to Serving webp images with varnish in front + nginx with pagespeed as backend

513 views
Skip to first unread message

thenewca...@gmail.com

unread,
Jul 26, 2014, 2:50:47 AM7/26/14
to mod-pagesp...@googlegroups.com
Hello,

I tried to setup my server with varnish in front, nginx as backend with pagespeed

Everything works well untill I found that "sometime", firefox can't display big photo that was converted by pagespeed in .webp format. 

I said sometime because actually it worked well already but sometime I see the image broken, not display well. ( but when I copy that image link and open in new firefox task, it still display well ??? This is sound stranger.. )

Do you have any advice to help me serving .webp in firefox with this server software?

Here is my nginx config for pagespeed

                pagespeed on;

                pagespeed FileCachePath /var/ngx_pagespeed_cache;

                pagespeed FileCacheSizeKb            102400;

                pagespeed FileCacheCleanIntervalMs   3600000;

                pagespeed FileCacheInodeLimit        500000;

                pagespeed LRUCacheKbPerProcess     8192;

                pagespeed LRUCacheByteLimit        16384;

                #pagespeed EnableFilters combine_css,extend_cache,rewrite_images;

                pagespeed EnableFilters combine_css,extend_cache;

                pagespeed EnableFilters rewrite_css,rewrite_javascript,prioritize_critical_css;

                #pagespeed EnableFilters recompress_images;

                pagespeed ModifyCachingHeaders off;

                pagespeed RespectVary on;

                pagespeed ServeRewrittenWebpUrlsToAnyAgent off;

#  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 ~ "^/ngx_pagespeed_static/" { }

location ~ "^/ngx_pagespeed_beacon" { }

location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }

location /ngx_pagespeed_global_statistics { allow 127.0.0.1; deny all; }

location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }

location /pagespeed_console { deny all; }

Joshua Marantz

unread,
Jul 26, 2014, 6:32:29 AM7/26/14
to mod-pagespeed-discuss
To cache HTML downstream of ngx_pagespeed, you must set up downstream caching by configuring Varnish and PageSpeed as described here:


This will cache the HTML for webp-compatible browsers with a separate key from HTML for older browsers.  It will also deal properly with PageSpeed's background rewrite strategy, where the initial view of a page may be partially unoptimized, and you don't want the cache to record that version.

-Josh


--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/ce068345-ad3b-4c0a-bf88-8498304ff9a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages