Opcache (fastcgi_cache_key) and GeoIP
June 24, 2015 04:54AM
Hi,

I've searched Google / this forum for this but can't find anything relevant so apologies in advance if this has been covered elsewhere.

I've enabled Opcache on my server and have GeoIP enabled.

The default fastcgi_cache_key directive is:

fastcgi_cache_key "$scheme$request_method$host$request_uri";

How can this be modified to include the user country (from GeoIP) so that each country has a separate cache entry for each page?

As far as I'm aware, the GeoIP headers are set in the server {} block which is loaded after /etc/nginx/nginx.conf (where the fastcgi_cache_key) is set.

Additionally, I've tried setting the fastcgi_cache_key in the individual site conf file but this only works when only 1 site is enabled.

Have I missed a really simple step here?

Many thanks,

James
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 243
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