I currently need to avoid caching Ajax requests, but in order to cache the result pages.
I know which directives prohibit caching: proxy_no_cache or proxy_cache_bypass But how to add the correct statement. Via if block? Should the statement be like this?
$http_x_requested_with=XMLHttpRequest
Thanks;)
Update
Like this?
proxy_cache_bypass $http_x_requested_with=XMLHttpRequest; proxy_no_cache $http_x_requested_with=XMLHttpRequest;
source share