我目前需要避免缓存Ajax请求,但仍要缓存结果页面。
我知道哪些指令禁止缓存: proxy_no_cache或proxy_cache_bypass, 但如何添加适当的语句呢?通过if块吗? 语句应该像这样:
$http_x_requested_with=XMLHttpRequest
谢谢;) 更新 这样可以吗?
proxy_cache_bypass $http_x_requested_with=XMLHttpRequest;
proxy_no_cache $http_x_requested_with=XMLHttpRequest;