nginx cache module v 2.0

pf shineyear shinepf at gmail.com
Thu Jul 24 05:28:39 MSD 2008


PURGE can delete the cache files, is used by a php program like this:

<?php

http_purge("127.0.0.1", 9080, "/t_n_cahce.xml?uid=1145642397");


function http_purge($ip, $port, $url)
{
    $errstr = '';
    $errno = '';
    $fp = @fsockopen ($ip, $port, $errno, $errstr, 1);

    if (!$fp)
    {
        return "$errstr ($errno)";
    }
    else
    {

        $out = "PURGE $url HTTP/1.1\r\n";
        $out .= "Host: blog.sina.com.cn\r\n";
        $out .= "Connection: close\r\n\r\n";

        print $out;

        fputs ($fp, $out);

        while (!feof($fp))
        {
            echo fgets($fp, 128);
        }

        fclose ($fp);
    }
}
?>

On Wed, Jul 23, 2008 at 6:26 PM, Alan Williamson <alan at blog-city.com> wrote:
> oooh this is very sweet.
>
> can you talk a little on how your PURGE directive works?
>
>
> pf shineyear wrote:
>>
>> NCache is a nginx cache module like squid now version is 2.0
>> you can get it here : www.ncache.org
>>
>
> --
> Alan Williamson
>  Registrationless email/sms reminders:  http://yourli.st/
>  blog:  http://alan.blog-city.com/
>
>





More information about the nginx mailing list