Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_key with cookie

António P. P. Almeida
December 27, 2011 02:36AM
On 27 Dez 2011 06h53 WET, nginx-forum@nginx.us wrote:

> Thx for replying, but I have already tried this config from
> drupal.org.
>
> With this config it will not cache the page correct? What I'm
> trying to do is set every page to be cached whether logged in or
> not, or more specifically to maintain a separate cache for each
> user. But I need to differentiate the cache key based on the
> session cookie.

Why not implement a small module that sets a DRUPAL_UID cookie and use
that as a cache key? Much simpler than using the session cookie.

Take a look at what the boost module does. I can put up a simple
module that does that. Are you on drupal 6/pressflow?

> I need to optimize for authenticated performance, our website has
> 90% logged in users, our non authenticated speed for nginx is more
> than sufficient now. On my crappy laptop I can get 4000+ req/s for
> non authenticated pages, for authenticated pages I get 2 req/sec
> without any caching at all. With fastcgi caching I can get 3000+
> req/sec, but this is without google analytics, as soon as I enable
> it my speed plunges down to 2req/sec :(

Ok. Then what you need is a better key. If you have the DRUPAL_UID
cookie then set:

fastcgi_cache_key $http_cookie_DRUPAL_UID$scheme$host$request_uri;

That's a cool idea for a very simple module.

There's a hack here for setting a DRUPAL_UID cookie but it involves
killing kittens: hacking core :)

http://groups.drupal.org/node/194333

--- appa

PS: Here's a very simple module that sets a header, not a cookie. It's
untested YMMV, caveat emptor, and all that:
https://gist.github.com/1522957

The .info file is missing.

PPS: Use this key with the above module.

fastcgi_cache_key $http_x_drupal_uid$scheme$host$request_uri;

_______________________________________________
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: 233
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready