nginx fastcgi_cache を使用する場合、HTTP 200 応答を他の HTTP コードよりも長くキャッシュします。このコードに基づいて、expires ヘッダーを条件付きで設定できるようにしたいと考えています。
例えば:
fastcgi_cache_valid 200 302 5m;
fastcgi_cache_valid any 1m;
if( $HTTP_CODE = 200 ) {
expires 5m;
}
else {
expires 1m;
}
上記のようなことは可能ですか (場所コンテナー内)?