Welcome! Log In Create A New Profile

Advanced

Re: Caching fastcgi url

Francis Daly
June 23, 2015 06:40PM
On Tue, Jun 23, 2015 at 06:27:30PM -0400, CJ Ess wrote:

Hi there,

> So looks like your saying the best way to do it is to do a separate
> location and duplicate the fastcgi setup in that location and add the
> fastcgi_cache stuff.

It strikes me as clearer to have one extra location{} than to have a
map{} or an if() to set a variable and then use fastcgi_no_cache and/or
fastcgi_cache_bypass with that variable.

But either way should work.

I'm not going to be the one trying to understand it in a year's time.

> I can work with that, however I came across this example while googling (
> https://gist.github.com/magnetikonline/10450786) that uses "if" to set a
> variable which I could use to match on the URL and trigger
> fastcgi_cache_bypass for everything not matching. Is "if" so toxic that I
> shouldn't consider doing it this way?

"if" seems fine for that, so long as it is not inside location{}.

I'd probably use "map", though, if I were going to do that.

f
--
Francis Daly francis@daoine.org

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

Caching fastcgi url

CJ Ess June 23, 2015 04:22PM

Re: Caching fastcgi url

Francis Daly June 23, 2015 06:08PM

Re: Caching fastcgi url

CJ Ess June 23, 2015 06:28PM

Re: Caching fastcgi url

Francis Daly June 23, 2015 06:40PM

Re: Caching fastcgi url

ryd994 June 24, 2015 12:40PM

Re: Caching fastcgi url

CJ Ess June 24, 2015 01:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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