I'm using memcached to store html content ready for nginx to display but I'm getting the compressed output in the browser.
It works if I turn off compression in PHP but doubles the response time which is the key part here so ideally I'd like to keep the compression on and decompress in nginx.
Any suggestions?
Here is the conf;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /usr/local/nginx/conf/mime.types;
server {
listen 80;
server_name mydomain.com;
access_log /path/to/access/log/access_log;
error_log /path/to/error/log/error_log;
root /default/path/to/files;
location ~* \.(jpg|png|gif|css|js|swf|flv|ico|html|woff|ttf|svg|htm)$ {
try_files $uri $uri/ $uri.html @notcached;
}
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 240;
include fastcgi_params;
}
location / {
default_type text/html;
set $enhanced_memcached_key "$server_name$request_uri";
enhanced_memcached_hash_keys_with_md5 on;
enhanced_memcached_pass memcache.local:11211;
error_page 404 = @notcached;
}
location @notcached {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /u1/live/sites/public_html/index.html;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_read_timeout 240;
include fastcgi_params;
}
}
}