|
MythTV master
|
#include <libmythbase/http/mythhttpcache.h>
Static Public Member Functions | |
| static void | PreConditionCheck (const HTTPResponse &Response) |
| Process precondition checks. More... | |
| static void | PreConditionHeaders (const HTTPResponse &Response) |
| Add precondition (cache) headers to the response. More... | |
Definition at line 7 of file mythhttpcache.h.
|
static |
Process precondition checks.
This should be the first step in processing an HTTP request, typically only when there is meaningful content to be returned (i.e. it is not used for error responses, even though they may contain content).
The status of the response may be updated and the ETag for the content may be set.
'Last-Modified' and 'ETag' outgoing headers are supported, dependant on the cache setting for the content. This defaults to HTTPIgnoreCache for errors etc, HTTPLastModified for files and HTTPNoCache for in-memory data responses. It is expected that the latter will be configured as required by the handler's implementation.
'If-Modified-Since', 'If-None-Match' and 'If-Range' headers are supported in incoming headers (i.e. last modified and ETag validators).
There is currently no suport for 'If-Match' and 'If-Unmodified-Since' headers.
We only ever use one validator and it is assumed the validator is used consistently. i.e. we use ETag or Last-Modified across invocations and not both. This ensures the client sends the correct validator in response.
Definition at line 50 of file mythhttpcache.cpp.
Referenced by MythHTTPResponse::DataResponse(), and MythHTTPResponse::FileResponse().
|
static |
Add precondition (cache) headers to the response.
Must be after a call to PreConditionCheck.
Definition at line 158 of file mythhttpcache.cpp.
Referenced by MythHTTPResponse::DataResponse(), and MythHTTPResponse::FileResponse().