pub struct MaxFileSizeMissHandler { /* private fields */ }
Expand description
MaxFileSizeMissHandler wraps a MissHandler to enforce a maximum asset size that should be written to the MissHandler.
This is used to enforce a maximum cache size for a request when the response size is not known ahead of time (no Content-Length header). When the response size is known ahead of time, it should be checked up front (when calculating cacheability) for efficiency. Note: for requests with partial read support (where downstream reads the response from cache as it is filled), this will cause the request as a whole to fail. The response will be remembered as uncacheable, though, so downstream will be able to retry the request, since the cache will be disabled for the retried request.
Implementations§
Source§impl MaxFileSizeMissHandler
impl MaxFileSizeMissHandler
Sourcepub fn new(
inner: MissHandler,
max_file_size_bytes: usize,
) -> MaxFileSizeMissHandler
pub fn new( inner: MissHandler, max_file_size_bytes: usize, ) -> MaxFileSizeMissHandler
Create a new MaxFileSizeMissHandler wrapping the given MissHandler