<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 06/07/2011 10:26, Nuno Neves wrote:
<blockquote cite="mid:20110706092649.283130@gmx.com" type="cite"><span
style="font-family: Verdana;"><span style="font-size: 12px;">how
can I get the hiden input value I have that tell varnish that
we have a new post? <br>
<br>
<span class="webkit-html-tag"><input <span
class="webkit-html-attribute-name">type</span>="<span
class="webkit-html-attribute-value">hidden</span>" <span
class="webkit-html-attribute-name">name</span>="canpurge"
<span class="webkit-html-attribute-name">value</span>="/topic/123-my-topic/"
/></span> <br>
<br>
I was thinking of something like this:<br>
<br>
<div> sub vcl_recv {</div>
<div> if (req.request == "POST" && FORM.FIELD ==
"canpurge) {</div>
<div> purge req.http.host == example.com &&
req.url ~ ^FORM.CANPURGE.VALUE.*$</div>
<div> }</div>
<div> }</div>
</span></span></blockquote>
<br>
Nuno: <br>
<br>
Varnish can't see the body of the response. However, if you're able
to change the response, you can just add an HTTP header with this
information. Then, in vcl_fetch (which is where the HTTP request is
sent to the backend), you can probably add something like:<br>
<br>
sub vcl_fetch {<br>
if (beresp.http.x-purgepattern) {<br>
purge("obj.http.host == example.com && req.url ~ "
beresp.http.x-purgepattern);<br>
}<br>
}<br>
<br>
<br>
Rob<br>
</body>
</html>