POST going through but returning cached page ?

Mark S. mark.staudinger at
Thu Dec 17 17:22:32 CET 2015

On 12/17/15 9:49 AM, Xavier Cardil Coll wrote:
> Hi, I am using this config for a wordpress-woocommerce with 
> mod_pagespeed, but something weird happens on when I try to log in or 
> register a user. I have made sure the /my-account/ is not cached and 
> that the POST request to send the data at login / register is not 
> cached, actually it works. Users login and register, but after one of 
> those actions, the server returns the same form page with the form 
> being empty, while it should return the "my account" page with the 
> data of the user logged in. Can you please shed some light ?
> Here is the pasta of my config :
> Thanks !
> -- 

Hi Xavier,

Two things jump out at me.

1) You have several matching rules with extraneous '*' characters. For 
example, your vcl line 91

if(req.url ~ 

Since we are using the "~" match, this might be better represented by

if ( req.url ~ 
"^(cart|my-account/|checkout|addons|logout|lost-password|product/)" ) {

This isn't a problem, but it may make the usage clearer.

2) Between lines 67 and 130 you have many test cases on when to pass.   
Following that, you have a section that removes cookies, including 
WordPress cookies, with no conditions.  But I do not see any VCL above 
line 130 that issues a pass based on the presence of a WordPress cookie.

It would help to see the varnishlog of what happens after the POST/login 
and the cached page, but one likely possibility is a page load that you 
aren't matching in lines 67-130 that is arriving without the proper cookies.

I would expect to see something like this before you start un-setting 
cookies around line 140

if (req.url ~ 
     unset req.http.Cookie;
     return (hash);

if ( req.http.Cookie ~ "wordpress_" ) {
     return (pass);

This type of action might allow you to short-cut much of the "COOKIE 
MADNESS" section by wrapping in a " if req.http.Cookie " check.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list