fastcgi_cache_bypass. Need some explain.

wishmaster artemrts at ukr.net
Thu Sep 11 09:01:00 UTC 2014


Hi,

I am attempting to configure nginx to avoid caching some data.

        map $http_x_requested_with $no_cache {
            default 0;
            "XMLHttpRequest" 1;
        }

        fastcgi_cache_bypass $no_cache;
        fastcgi_no_cache $no_cache;

With above configuration exceptions works fine, but with below - not. Why?

        fastcgi_cache_bypass $http_x_requested_with;
        fastcgi_no_cache $http_x_requested_with;

With above config all requests (not only with "X-Requested-With: XMLHttpRequest") is bypassed.

--
Cheers,
Vit



More information about the nginx mailing list