Welcome! Log In Create A New Profile

Advanced

Re: [nginx] Entity tags: explicit flag to skip not modified filter.

Maxim Dounin
July 16, 2014 11:56AM
Hello!

On Mon, Jul 14, 2014 at 03:58:10PM -0700, Yichun Zhang (agentzh) wrote:

> Hello!
>
> On Wed, Jun 25, 2014 at 3:40 PM, Maxim Dounin wrote:
> >
> > + r->disable_not_modified = !u->cacheable;
> > +
>
> Hmm, this line of change is giving me problems to fix the new
> regression in my ngx_memc module's "memc_flags_to_last_modified"
> feature (https://github.com/openresty/memc-nginx-module#memc_flags_to_last_modified
> ) caused by nginx 1.7.3.
>
> It seems that there is no hooks for 3rd-party upstream C modules to
> override this r->disable_not_modified field? The nearest hook,
> u->process_header, is called *before* the
> ngx_http_upstream_process_headers function setting this flag. And
> setting u->cacheable leads to undesired side effects in
> ngx_http_upstream_send_response(), which is also just too hacky.
>
> Any hints on this?

As the r->disable_not_modified is a flag that affects response
returned, it's something to be set during the copy headers
process. Protocol modules are not expected to be able to (and
even try to) influence this except by providing appropriate
upstream response headers.

The same applies to r->headers_out.last_modified_time
modifications in your module - what previously worked in your
module was a hack, and there is no surprise it no longer works
after changes.

I see two possible ways to make it work again:

- Implement appropriate flag in upstream (or upstram
configuration) to make it possible to activate not modified
filter for responses which doesn't use cache.

- Emulate 304 responses by the module itself.

The latter is obviously easier from nginx core point of view. :)
Also, it should be compatible with all nginx versions.

--
Maxim Dounin
http://nginx.org/

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

[nginx] Entity tags: explicit flag to skip not modified filter.

Maxim Dounin 585 June 25, 2014 06:42PM

Re: [nginx] Entity tags: explicit flag to skip not modified filter.

Yichun Zhang (agentzh) 251 July 14, 2014 07:00PM

Re: [nginx] Entity tags: explicit flag to skip not modified filter.

Maxim Dounin 260 July 16, 2014 11:56AM

Re: [nginx] Entity tags: explicit flag to skip not modified filter.

Yichun Zhang (agentzh) 274 July 16, 2014 03:50PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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