Skip to content

Commit

Permalink
* Fixed POST detection for Boost.
Browse files Browse the repository at this point in the history
  • Loading branch information
António P. P. Almeida committed Mar 7, 2012
1 parent c86ab8d commit 79d3990
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 0 additions & 8 deletions map_cache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
### Testing if we should be serving content from cache or not. This is
### needed for any Drupal setup that uses and external cache.

## Testing the request method. Only GET and HEAD are caching
## safe. This is only needed for Boost. If using microcaching you
## comment out the map directive below.
map $request_method $no_cache {
default 0;
POST 1; # POST requests aren't cached usually
}

## 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
Expand Down
5 changes: 5 additions & 0 deletions sites-available/drupal_boost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ location @cache {
return 418; # I'm a teapot/I can't get no cachifaction
}

## No caching for POST requests.
if ($request_method = POST) {
return 418;
}

# Now for some header tweaking. We use a date that differs
# from stock Drupal. Everyone seems to be using their
# birthdate. Why go against the grain?
Expand Down
10 changes: 10 additions & 0 deletions sites-available/drupal_boost6.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ location / {
return 418; # I'm a teapot/I can't get no cachifaction
}

## No caching for POST requests.
if ($request_method = POST) {
return 418;
}

try_files /cache/normal/$host/_${args}.html /cache/perm/$host/_.css /cache/perm/$host/_.js /cache/$host/0/.html /cache/$host/0/index.html /index.php;
}

Expand Down Expand Up @@ -214,6 +219,11 @@ location @cache {
return 418; # I'm a teapot/I can't get no cachifaction
}

## No caching for POST requests.
if ($request_method = POST) {
return 418;
}

# Now for some header tweaking. We use a date that differs
# from stock Drupal. Everyone seems to be using their
# birthdate. Why go against the grain?
Expand Down

0 comments on commit 79d3990

Please sign in to comment.