forked from perusio/drupal-with-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_cache.conf
27 lines (23 loc) · 1 KB
/
map_cache.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- mode: nginx; mode: flyspell-prog; ispell-current-dictionary: american -*-
### Testing if we should be serving content from cache or not. This is
### needed for any Drupal setup that uses and external cache.
## Testing for the session cookie being present. If there is then no
## caching is to be done. Note that this is for someone using either
## Drupal 7 pressflow or stock Drupal 6 core with no_anon
## (http://drupal.org/project/no_anon).
map $http_cookie $no_cache {
default 0;
~SESS 1; # PHP session cookie
}
## If you're using stock Drupal 6 without no_anon, i.e., there's a
## session cookie being served even to anonymous users, then uncomment
## the three lines below and comment the above map directive
# map $http_cookie $no_cache {
# default 0;
# ~DRUPAL_UID 1; # DRUPAL_UID cookie set by Boost
# }
## Set a cache_uid variable for authenticated users.
map $http_cookie $cache_uid {
default nil; # hommage to Lisp :)
~SESS[[:alnum:]]+=(?<session_id>[[:graph:]]+) $session_id;
}