Welcome! Log In Create A New Profile

Advanced

Re: Mapping non-empty $query_string

June 15, 2016 02:00AM
On 15 Jun 2016, at 02:37, Supersmile2009 <nginx-forum@forum.nginx.org> wrote:

> Hi!
> I'm running a Wordpress based website on my server, I've set up fastcgi
> cache recently. Now I want to get rid of evil-ifs, that are used to detect
> cache skipping cases, and replace them with map.
>
> I managed to convert all common ifs except this one,
>
> if ($query_string != "") {
> set $skip_cache 1;
> }
>
> I'm trying to replace it with non-evil map in http section.
>
> #skip cache if query string has at least one character
> map $query_string $skip_cache {
> "~.+" "1";
> }
>
> For some reason it doesn't work as intended. It starts bypassing cache on
> ALL pages except main page.

map $query_string $skip_cache {
"" 0;
default 1;
}


--
Igor Sysoev
http://nginx.com

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Mapping non-empty $query_string

Supersmile2009 June 14, 2016 07:37PM

Re: Mapping non-empty $query_string

Igor Sysoev June 15, 2016 02:00AM

Re: Mapping non-empty $query_string

Supersmile2009 June 15, 2016 08:12AM

Re: Mapping non-empty $query_string

B.R. June 15, 2016 01:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 252
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