Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-31 Thread seo010
Just for the record: this topic contains 2 suggested solutions: 1) storing gzip compressed and uncompressed HTML separately and have Nginx determine gzip support instead of the client 2) storing gzip permanently and use Nginx gunzip module to gunzip HTML for browsers without gzip support Posted

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-31 Thread seo010
Hi Lucas, Thanks a lot for the information! Hopefully it will help many others that find the topic via Google as there was almost no information about it available. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,270604,270665#msg-270665

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-31 Thread Lucas Rolff
Hello, It's not strange behavior, it's expected. What happens is that even though the key is the same - the actual returned content *might* be different, e.g. as an example: If your origin returns Vary: accept-encoding Nginx will cache based on this - so if accept-encoding differs it means

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-31 Thread seo010
Hi Lucas, Thanks a lot for the suggestion. We were already using that solution but a strange behavior occurred (see opening post). The first request uses an expected MD5 hash of the KEY, and the client will keep using that hash (the MISS/HIT header is accurate). However, requests from other

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-30 Thread Lucas Rolff
Well - then put fastcgi_ignore_headers Vary, make your map determine if the client support gzip or not, then you'll have 2 entries of everything, 1 gzipped and one not gzipped. I'm not sure how much traffic we're talking about when it's about 'high traffic' - you'd probably want to run your

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-30 Thread seo010
Hi! It sounds like a good solution to improve the performance, however, I just read the following post by Jake Archibald (Google Chrome developer). "Yeah, ~10% of BBC visitors don’t support gzip compression. It was higher during the day (15-20%) but lower in the evenings and weekends (<10%).

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-30 Thread Lucas Rolff
What you could do (I basically asked the same question 1 week ago), is that whenever you fastcgi_pass then enforce accept-encoding: gzip - meaning you'll always request gzipped content from your backend - then you can enable the gunzip directive by using "gunzip on;" This means in case a

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-30 Thread seo010
Hi *B. R.*! Thanks a lot for the reply and information! The KEY however, does not contain different data from http_accept_encoding. When viewing the contents of the cache file it contains the exact same KEY for both MD5 hashes. Also, it does not matter what browser is used for the first request.

Re: Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-29 Thread B.R.
$http_accept_encoding gets the value of the HTTP Accept-Encoding header. This might vary depending on the client being used, unless you control them and their value. Thus, the same request being made with a different (set of) value(s) in this header will generate another key. If you simply want

Pre-compressed (gzip) HTML using fastcgi_cache?

2016-10-27 Thread seo010
Hi! I was wondering if anyone has an idea to serve pre-compressed (gzip) HTML using proxy_cache / fastcgi_cache. I tried a solution with a map of http_accept_encoding as part of the fastcgi_cache_key with gzip compressed output from the script, but it resulted into strange behavior (the MD5 hash