fastcgi_cache_key with cookie
nginx-forum at nginx.us
Tue Dec 27 05:13:37 UTC 2011
I'm trying to cache per user Drupal using this config :
fastcgi_ignore_headers Cache-Control Expires; #tried '__utma'
fastcgi_cache_methods GET HEAD;
fastcgi_cache_valid any 1s;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
add_header X-Micro-Cache $upstream_cache_status;
I can get this working without google analytics, but when I enable
google analytics it adds several cookies __utma __utmb __utmc __utmz.
Nginx looks at $http_cookie and sees that its different so it passes it
to the backend. Preferably I would like to just use the cache key as
$cookie_SESS which is the drupal session cookie, however the full cookie
name is encoded to something like this
I've omitted some letters and numbers. So my question is how do I just
extract the Drupal Session cookie? Or failing that just strip all
cookies? I have tried fastcgi_ignore header '__utma' 'Set-Cookie' but
it doesn't seem to work.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,220510,220510#msg-220510
More information about the nginx