<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>Using this code I get an error when starting varnish 3.0</div><div><br></div><div>The code:</div><div><br></div><div><div>sub vcl_fetch {</div></div><div> if (beresp.http.X-Purge) {</div><div><div> purge("obj.http.host == <a href="http://example.com">example.com</a> && req.url ~ " beresp.http.X-Purge);</div><div> }</div></div><div>}</div><div><br></div><div><br></div><div>The error:</div><div><br></div><div><div> * Starting HTTP accelerator varnishd</div><div> ...fail!</div><div>SMA.s0: max size 256 MB.</div><div>Message from VCC-compiler:</div><div>Expected ';' got '('</div><div>(program line 174), at</div><div>('input' Line 52 Pos 11)</div><div> purge ("obj.http.host == <a href="http://example.com">example.com</a> && req.url ~ " beresp.http.X-Purge);</div><div>----------#---------------------------------------------------------------------------</div></div><div><br></div><div>What do I need to change?</div><div><br></div><div>Thanks</div><div><br></div><div>Nuno</div><div><br></div><div><br></div><div><br><div><div>A 2011/07/06, ās 11:25, Rob S escreveu:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div 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 == <a href="http://example.com">example.com</a> &&
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 == <a href="http://example.com">example.com</a> && req.url ~ "
beresp.http.x-purgepattern);<br>
}<br>
}<br>
<br>
<br>
Rob<br>
</div>
_______________________________________________<br>varnish-misc mailing list<br><a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</blockquote></div><br></div></body></html>