Hi,
I am trying setup fastcgi_cache.
Working fine… BUT I need bypass some pages… when theses pages have
header “no-cache”… but I dont know how to do this…
The rules for bypass using urls, work fine… like this:
if ($request_uri ~*
"(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)")
{
set $cache_uri 'null cache';
}
How can I bypass cache setting header page “no-cache” ?
Example, in varnish work fine:
if (req.http.Cache-Control ~ “no-cache”)
{
return (pipe);
}
Hi, I already try this… but… not work =/
when in the page, I do “shift+f5”, page is re-read “EXPIRED”… OK
but, this entering in the page, or do F5 … page = HIT cache…
In this specifics pages, I always put php header “cache-control, pragma,
etc” as “no-cache”, so, I want always get a new page from backend…
understand?
On Mon, Jun 23, 2014 at 01:08:33PM -0400, ariel_esp wrote:
Hi, I already try this… but… not work =/
when in the page, I do “shift+f5”, page is re-read “EXPIRED”… OK
but, this entering in the page, or do F5 … page = HIT cache…
In this specifics pages, I always put php header “cache-control, pragma,
etc” as “no-cache”, so, I want always get a new page from backend…
understand?
As long as response headers contain “Cache-Control: no-cache”,
nginx will not cache a response, unless explicitly asked to ignore
the Cache-Control header (using the fastcgi_ignore_headers
directive). No special handling is needed, it will just work.
If it doesn’t work for you, this likely means that:
either you did something wrong in your nginx config (i.e., used
fastcgi_ignore_headers to disable Cache-Control handling);
or you wrote the “Cache-Control: no-cache” incorrectly.