set $tmp_cache_key_webp "";
if ($http_accept ~ image/webp) {
  set $tmp_cache_key_webp "1";
}

proxy_cache_key $scheme$proxy_host$uri$is_args$args$tmp_cache_key_webp;
proxy_cache_bypass $cookie_nocache $arg_nocache;
proxy_cache_lock on;
proxy_cache_lock_timeout 5s;
proxy_cache_lock_age 5s;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
proxy_cache_revalidate on;
proxy_cache_min_uses 1;

add_header X-Cache-Status $upstream_cache_status;
