I used the following snippet in a custom module with the redirect module.
/**
* Implementation of drupal_goto_alter()
*/
function XXXX_drupal_goto_alter(&$path, $options, $http_response_code)
{
//If drupal_goto is asked to do a redirect (essentially via global_redirect),
//then cache this as well (by default, it isn't, drupal_goto calls drupal_exit
//which do not cache the result)
if($http_response_code == 301 || $http_response_code == 302)
{
if ($cache = drupal_page_set_cache()) {
drupal_serve_page_from_cache($cache);
}
}
}
It caused my site to completely go down in 503-error flames.
I'm attaching the Varnish log from one of the requests that resulted in an error.
We are running D7.19. Redirect 7.x-1.0-rc1. Nginx 1.2.7, MySQL, PHP 5.3.20 & memcache 3.0.7.
Once I removed this function from the custom module, everything was back to normal.
Comments
Comment #1
torpy commentedHaving this issue with the following config:
nginx 1.4 (HTTPS) -> Varnish 3.0.5 (HTTP) -> IIS8 -> PHP 5.3
The error varnish gives is FetchError c Invalid Gzip data: incorrect header check. More info in Varnish issue #1220.
A cleaner patch is attached that disables the cache if the varnish module is enabled. This is probably not the best way to do things but I can't think of a better way to implement it.
Comment #2
dave reidI've used the redirect module with Varnish successfully. This sounds like an issue with the custom code.