The problem is about how to purge the cache by the http.<br>
When my hash is the fellow ,I can solve it<br>
<br>
sub vcl_hash {<br>
set req.hash += req.url;<br>
hash;<br>
}<br>
<br>
I have write a php file to purge the cache<br>
<br>
<?php<br>
function purge($ip, $domain, $url)<br>
{<br>
$errstr = '';<br>
$errno = '';<br>
$fp = fsockopen ($ip, 80, $errno, $errstr, 2);<br>
if (!$fp)<br>
{<br>
return false;<br>
}<br>
else<br>
{<br>
$out = "PURGE $url HTTP/1.1\r\n";<br>
$out .= "Host:$domain\r\n";<br>
$out .= "Connection: close\r\n\r\n";<br>
fputs ($fp, $out);<br>
$out = fgets($fp , 4096);<br>
echo $out;<br>
fclose ($fp);<br>
return true;<br>
}<br>
}<br>
<br>
$domain = $_GET['a'];<br>
$imgurl = $_GET['b'];<br>
<br>
$squid = array(<br>
'221.238.196.199',<br>
'221.238.196.200',<br>
);<br>
<br>
foreach($squid as $ip)<br>
{<br>
if(!empty($ip))<br>
{<br>
purge($ip, $domain, $imgurl);<br>
echo "clear is over";<br>
}<br>
}<br>
<br>
?><br>
<br>
But, I change the hash, use the similar way but can't clear it ,output<br>
"HTTP/1.1 404 Not in cache "<br>
<br>
sub vcl_hash {<br>
set req.hash += req.url;<br> if (req.http.Accept-Encoding) {<br>
set req.hash += req.http.Accept-Encoding;<br>
}<br>
hash;<br>
}<br>
<br><br>I have try use <br><br>$out = "PURGE $url HTTP/1.1\r\n";<br>
$out .= "Host:$domain\r\n";<br> $out .= "Accept-Encoding:gzip,deflate\r\n";<br>
$out .= "Connection: close\r\n\r\n";<br>
fputs ($fp, $out);<br><br>and $out .= "Accept-Encoding:gzip\r\n";<br><br> $out .= "Accept-Encoding:deflate\r\n";<br><br>Without success.<br><br>
who can tell me how to purge the hash cache ,how to write the php ,I need<br>
through remote empty cache ,thanks.<br>
<br>
I hope you can understand what I mean, my English is pool.<br>
<br>
<br>
Ajian<br>====================================================================<br><br>