ワニス4.1のサーバの後ろにある私たちのアプリケーションで負荷テストを実行していたとき、サーバ・エラー(500が返されたのはCache-Control: no-cache
)の後、私たちはバックエンド・クリーン。ページがno-cache
を返した場合、それは次の2分間キャッシュ可能ではありませんワニスのヒット・フォー・パス
sub vcl_backend_response {
if (bereq.uncacheable) {
return (deliver);
} else if (beresp.ttl <= 0s ||
beresp.http.Set-Cookie ||
beresp.http.Surrogate-control ~ "no-store" ||
(!beresp.http.Surrogate-Control &&
beresp.http.Cache-Control ~ "no-cache|no-store|private") ||
beresp.http.Vary == "*") {
# Mark as "Hit-For-Miss" for the next 2 minutes
set beresp.ttl = 120s;
set beresp.uncacheable = true;
}
return (deliver);
}
、場合でも、次のコールバックエンド:ワニスの設定我々はその行を見つけるhttps://github.com/varnishcache/varnish-cache/blob/master/bin/varnishd/builtin.vcl#L157 でダイビングのafer
有効なキャッシュ可能な応答を返します。これはデフォルトの動作である理由私は私の場合は(...長い時間前にリポジトリの履歴に応じているので)
を把握することはできません
、私のバックエンドでエラーが、500ノーキャッシュを生成し、その後、より多くのトラフィックにつながり、最後に503を引き起こします。
私はこのルールを削除する予定ですが、前もって理解したいと思います。
ヒント?あなたがヒットのためにパスを理解すること
https://info.varnish-software.com/blog/hit-for-pass-varnish-cache
を読みたいかもしれません事前 で
おかげM.