Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#101 closed enhancement (fixed)

Support ETag/If-None-Match when proxy_http_version is 1.1

Reported by: Colin Mollenhour Owned by: somebody
Priority: minor Milestone:
Component: nginx-module Version: 1.1.x
Keywords: Cc:
uname -a:
nginx -V: not applicable

Description

If HTTP/1.1 support is specified for the proxy module using proxy_http_version (1.1.4+) it could also support cache re-validation using ETags with the upstream.

Preferably there should be an option such as proxy_cache_etag with options off,replace,append. With "append", when the server sets a new ETag the old cached data should not be removed so that subsequent upstream requests specify an If-None-Match header with multiple ETag values so that the server can specify which ETag should be used. Effectively, multiple version of the Request-URI could be cached and upstream would determine which version is to be served. With "replace" the most recently specified ETag from upstream is the only one kept in the cache.

Change History (6)

comment:1 by Colin Mollenhour, 11 years ago

Just noticed Varnish is working on full support for If-None-Match: https://www.varnish-cache.org/trac/wiki/BackendConditionalRequests

comment:2 by Maxim Dounin, 10 years ago

Resolution: fixed
sensitive: 0
Status: newclosed

If-None-Match based cache revalidation (in addition to If-Modified-Since previously supported), was recently introduced (see 44b9ab7752e3 and c95d7882dfc9) and will be available in nginx 1.7.3.

in reply to:  2 comment:3 by Colin Mollenhour, 10 years ago

Replying to Maxim Dounin:

If-None-Match based cache revalidation (in addition to If-Modified-Since previously supported), was recently introduced (see 44b9ab7752e3 and c95d7882dfc9) and will be available in nginx 1.7.3.

Nice work, Maxim. Does this new version support caching multiple versions of the same resource? That is, the "If-None-Match" header can support passing multiple ETags and the upstream responds with just one of them. Of course to support this nginx needs to be able to store multiple responses for the same cache key with their respective ETags.

comment:4 by Maxim Dounin, 10 years ago

No, it doesn't support multiple representations of the same resource, and there are no plans to support this.

comment:5 by Colin Mollenhour, 10 years ago

So RFC2616 is only partially supported.. What good is If-None-Match if it doesn't support real server-side content negotiation? Was hoping nginx would be the first proxy to boast full RFC2616 support but it sounds like there is no chance for that?

comment:6 by Maxim Dounin, 10 years ago

The main rationale is to support revalidation of responses without Last-Modified.

Note: See TracTickets for help on using tickets.