cacheable
A cacheable response can be stored to be retrieved and used later, saving a new request to the server.
Function parameters
Parameters
Type definitions in this namespace
Types
- Method
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
- Status
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
- TransferEncoding
- compression is intentionally omitted here since it is handled in `ContentEncoding`.
- BodyWriter
- Request or response body.
Source
Implementation
pub fn cacheable(m: Method) bool {
return switch (m) {
.GET, .HEAD => true,
.POST, .PUT, .DELETE, .CONNECT, .OPTIONS, .TRACE, .PATCH => false,
};
}