Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_key with cookie

António P. P. Almeida
December 27, 2011 01:38AM
On 27 Dez 2011 05h13 WET, nginx-forum@nginx.us wrote:

> I'm trying to cache per user Drupal using this config :
>
> fastcgi_ignore_headers Cache-Control Expires; #tried '__utma'
> 'Set-Cookie'
> fastcgi_cache drupal;
> fastcgi_cache_key $http_cookie$request_method$scheme$host$request_uri;
> fastcgi_cache_methods GET HEAD;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is not needed. This is the *default* setting. Cf.
http://wiki.nginx.org/HttpFcgiModule#fastcgi_cache_methods

> fastcgi_cache_valid any 1s;
> fastcgi_cache_use_stale error timeout invalid_header updating http_500;
>
> fastcgi_max_temp_file_size 2M;
> 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


> SSESSae42ac488e03c2e2xxxxxda6ce2f5ee7=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Remove that key and replace by:

fastcgi_cache_key $scheme$host$request_uri;

At the http level do:

map $http_cookie $no_cache {
default 0;
~SESS 1;
}

Then add:

## If we have a cookie we should bypass the cache. The same if we have a
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;

To the above FCGI cache config.

Also the first stop for drupal and Nginx stuff is the g.d.o group ;)

http://groups.drupal.org/nginx

--- appa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

fastcgi_cache_key with cookie

zenw December 27, 2011 12:13AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 01:38AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 01:53AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 01:56AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 02:36AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 02:46AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 02:48AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 03:02AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 03:24AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 04:06AM

Re: fastcgi_cache_key with cookie

brianmercer December 27, 2011 12:01PM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 02:54PM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 08:15PM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 08:35PM

Re: fastcgi_cache_key with cookie

brianmercer December 27, 2011 11:15PM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 11:28PM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 28, 2011 02:04AM

Re: fastcgi_cache_key with cookie

brianmercer December 28, 2011 08:55AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 28, 2011 11:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready