Welcome! Log In Create A New Profile

Advanced

Re: Re[2]: Invalidate just one page under a location directive.

Quintin Par
February 08, 2012 10:30PM
Thanks Antonio.

Great deal of help.

Looking into the wiki I see

“The following response headers flag a response as uncacheable unless they
are ignored <http://wiki.nginx.org/HttpProxyModule#proxy_ignore_headers>:

Set-Cookie

Cache-Control containing "no-cache", "no-store", "private", or a "max-age"
with a non-numeric or 0 value

Expires with a time in the past

X-Accel-Expires: 0“

This also means that if I send a curl call from my backend with a
Cache-Control : max-age=1, then the corresponding request/page in cache
will get invalidated the next second.

X-Accel-Expires also does the same thing I suppose. That solves my dilemma.

-Quintin
On Wed, Feb 8, 2012 at 10:40 PM, António P. P. Almeida <appa@perusio.net>wrote:

> On 8 Fev 2012 16h22 WET, quintinpar@gmail.com wrote:
>
> > Invalidate a cache page using the bypass mechanism
> > proxy_cache_bypass, not expiration
>
> IMHO the best option would be from the application side send a
> 'X-Accel-Expires: 0' header. But this needs to be done at the *app
> level*.
>
> Unless you place something in the headers that the application returns
> Nginx there's no way of Nginx to know what is going on.
>
> > To put it simply, Invalidate cache for a particular key entry but
> > not all of the cache
>
> > e.g for
> >
> > location = /vehicles {
> >
> > proxy_cache_key $request_uri;
> >
> > }
> >
> > Hashtable for cache:
> >
> > [
> >
> > http://jj.com/vehicles/cars => cached page for cars
> >
> > http://jj.com/vehicles/bus => cached page for bus
> >
> > http://jj.com/vehicles/bike=> cached page for bike
> > + 10,000 key, values
> > ]
>
>
> > I should be able to invalidate just "cars" because my page for cars
> > have changed but not others. Say a person added a comment in the
> > cars page. Another analogy is to invalidate cache for a single blog
> > post when all the blog posts have been cached under a single
> > location directive. -Quintin
>
> Send a 'X-Accel-Expires: 0' header from the application at:
>
> http://jj.com/vehicles/cars
>
> --- appa
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Invalidate just one page under a location directive.

Quintin Par February 08, 2012 02:46AM

Re: Invalidate just one page under a location directive.

Валентин Бартенев February 08, 2012 04:08AM

Re: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 04:38AM

Re: Invalidate just one page under a location directive.

Valentin V. Bartenev February 08, 2012 05:44AM

Re: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 06:10AM

Re[2]: Invalidate just one page under a location directive.

Max February 08, 2012 07:04AM

Re: Re[2]: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 07:20AM

Re: Re[2]: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 08:00AM

Re: Re[2]: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 11:00AM

Re: Re[2]: Invalidate just one page under a location directive.

António P. P. Almeida February 08, 2012 11:16AM

Re: Re[2]: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 11:24AM

Re: Re[2]: Invalidate just one page under a location directive.

António P. P. Almeida February 08, 2012 12:12PM

Re: Re[2]: Invalidate just one page under a location directive.

Quintin Par February 08, 2012 10:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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