Welcome! Log In Create A New Profile

Advanced

How to prevent caching ajax requests on proxy?

Posted by somebi 
How to prevent caching ajax requests on proxy?
May 21, 2011 03:51PM
I'm currently need to avoid caching ajax requests, but to keep caching the rest pages.

I know which directives disallow caching:

proxy_no_cache or proxy_cache_bypass

But how to add a proper statement. Via if block?

Statement should be like this?

$http_x_requested_with=XMLHttpRequest

As i understand, proxy directives is not allowed to user in IF context.

Thanks ;)



Edited 1 time(s). Last edit at 05/21/2011 04:00PM by somebi.
Re: How to prevent caching ajax requests on proxy?
May 21, 2011 04:14PM
Like that?

proxy_cache_bypass $http_x_requested_with=XMLHttpRequest;
proxy_no_cache $http_x_requested_with=XMLHttpRequest;
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready