werkzeug.ETagResponseMixin

class werkzeug.ETagResponseMixin[source]

Adds extra functionality to a response object for etag and cache handling. This mixin requires an object with at least a headers object that implements a dict like interface similar to Headers.

If you want the freeze() method to automatically add an etag, you have to mixin this method before the response base class. The default response class does not do that.

Methods

add_etag([overwrite, weak]) Add an etag for the current response if there is none yet.
freeze([no_etag]) Call this method if you want to make your response object ready for pickeling.
get_etag() Return a tuple in the form (etag, is_weak).
make_conditional(request_or_environ) Make the response conditional to the request.
set_etag(etag[, weak]) Set the etag, and override the old one if there was one.

Attributes

accept_ranges The Accept-Ranges header.
cache_control The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.
content_range The Content-Range header as ContentRange object.