Location support for multiple URLs

Hello,
I would like to use the FastCGI cache feature of nginx for my web
application. But I need to use it only for a set of URL.

I would like to use it for the following locations:

Domain.com[ANY ID HERE]

Example:
http://domain.com/index.php?act=detail&id=o2Zimg

And so on.
What should I place in the location directive to cache only those URLs?
I can’t figure it out on the nginx wiki.

Also, I would like to replace the Cache Control and Pragma headers set
by my PHP application, can I use add_headers directive? Or I would have
to add a 3rd party module, like more_http_headers? I use nginx from
PPA(Ubuntu), so for adding more_http_headers I would have to build it :confused:

Greetings from Antarctica.
Thanks.

On Sun, Apr 7, 2013 at 12:34 AM, Typlo [email protected] wrote:

And so on.
What should I place in the location directive to cache only those URLs?
I can’t figure it out on the nginx wiki.

Also, I would like to replace the Cache Control and Pragma headers set by my PHP
application, can I use add_headers directive? Or I would have to add a 3rd party
module, like more_http_headers? I use nginx from PPA(Ubuntu), so for adding
more_http_headers I would have to build it :confused:

There’s good reason people build urls like
http://domain.com/detail/2Zimg instead of what you’re using (namely,
it’s difficult to configure its caching).

(this email probably doesn’t help, yes)


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

You can do that.

At the http level set a map directive like:

map $arg_act$arg_ID $no_cache {
default 1;
~*detail[[:alnum:]]+ 0; # assuming the ID is alphanumeric
}

Then add:

fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;

to your FastCGI cache configuration.

As per the headers I don’t quite understand what you want to do. Do you
want the FastCGI cache to ignore the Cache-Control headers set by the
application?

----appa