Permalink
Browse files

* Fixed POST detection for Boost.

  • Loading branch information...
1 parent c86ab8d commit 79d399040e2f9eee260ce36550c9243da4629ae7 @perusio committed Mar 7, 2012
Showing with 15 additions and 8 deletions.
  1. +0 −8 map_cache.conf
  2. +5 −0 sites-available/drupal_boost.conf
  3. +10 −0 sites-available/drupal_boost6.conf
View
@@ -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
@@ -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?
@@ -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;
}
@@ -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?

0 comments on commit 79d3990

Please sign in to comment.