Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

purge content after POST request

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


tobias.eichelbroenner at lamp-solutions

May 10, 2012, 12:54 PM

Post #1 of 1 (110 views)
Permalink
purge content after POST request

Hi,

on a webpage behind varnish, visitors can leave comments.
New comments are sent to the server via htmlform using POST.

The Problem is, that new comments are not visible until I clear the cache.

I tried to purge or ban some content from cache, after a post request is
sent. For example like this:

sub vcl_recv {
if (req.request == "POST") {
ban("req.http.host == " + req.http.host + "&& req.url == " +
req.url);
return (pass);
}
}

or this:

sub vcl_fetch {
if (req.request == "POST") {
ban("req.http.host == " + req.http.host + "&& req.url == " +
req.url);
set beresp.ttl = 0h;
}
}

or even this:
sub vcl_hit {
if (req.request == "POST") {
purge;
}
return (deliver);
}

Does anyone solved a problem similar to mine?

Sincerly,

Tobias

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.