Disable caching on page request when serving from varnish based on url

Events happening in the community are now at Drupal community events on www.drupal.org.
ISPTraderChris's picture

We just moved our test site over to an AWS hosted solution based on the 1.0 Mercury AMI (love it!) with plans to take it live in the next couple of weeks. We are using a custom shopping cart solution that allows anonymous visitors to 'add' items to their cart via a URL (not via form submit). When the link is accessed, the custom module will instantiate a session (which in turns sets a cookie) to ensure that varnish is no longer serving cached pages. The module will keep this session active until the checkout process is complete, at which point it destroys the session / cookie in order to return control back to varnish.

Because the 'add' functionality involves a url call (i.e. /cart/add/[nid]/[qty]) and not a form submit, I'm not sure how I can ensure that varnish isn't simply returning a cached version of the 'add' url, which currently seems to be the case.

Is there an alternative to modifying the module so that the add functionality is a form submit, or is that pretty much my only option?

Thanks!

Comments

vcl file

mikeytown2's picture

This is what I put in for admin/* pages; I'm sure you can mod it to do what you need.

    ## Pass on admin pages
    if (req.url ~ "^/admin/.*$") {
       pass;
    }

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: