清漆不能快速/正确清洗

时间:2012-01-15 18:42:53

标签: joomla joomla1.5 varnish

我正在通过Apache / MySQL在Joomla网站前设置一个Varnish服务器。我已经得到Varnish与Apache合作,这里是Varnish配置:

acl purge {
    "localhost";
}


backend apache {
    .host = "127.0.0.1";
    .port = "8090";
}

sub vcl_recv {

    if (req.url ~ "^/administrator" ||
        req.url ~ "^/component/banners" ||
        req.request == "POST") {
            return (pass);
    }

    if (req.request == "PURGE") {
        if (!client.ip ~ purge) {
            error 405 "Not allowed.";
        }
        return (lookup);
    }

    if (req.http.Accept-Encoding) {
        if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
        # No point in compressing these
        remove req.http.Accept-Encoding;
        } elsif (req.http.Accept-Encoding ~ "gzip") {
        set req.http.Accept-Encoding = "gzip";
        } elsif (req.http.Accept-Encoding ~ "deflate") {
        set req.http.Accept-Encoding = "deflate";
        } else {
        # unkown algorithm
        remove req.http.Accept-Encoding;
        }
    }

    remove req.http.X_Forwarded-For;
    set req.http.X-Forwareded-For = client.ip;

    unset req.http.Cookie;

    set req.grace = 1h;

    return (lookup);
}

sub vcl_fetch {
    set beresp.grace = 1h;

    set beresp.ttl = 60s;
    return (deliver);
}

sub vcl_hit {
    if (req.request == "PURGE") {
        purge;
        error 200 "Purged.";
    }
}

sub vcl_miss {
    if (req.request == "PURGE") {
        purge;
        error 200 "Purged.";
    }
}

所以这是我的问题:当我创建一篇新文章/更新文章,并清除主页的缓存手册时,它不会清除它并使用新文章/更新更新缓存。

有什么建议吗?

此外,我当前的Varnish配置中的任何建议/添加/减少?

0 个答案:

没有答案