Function cacheable [src]
A cacheable response is an HTTP response that can be cached, that is stored to be retrieved and used later, saving a new request to the server.
https://developer.mozilla.org/en-US/docs/Glossary/cacheable
https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.3
Prototype
pub fn cacheable(self: Method) bool
Parameters
self: Method
Source
pub fn cacheable(self: Method) bool {
return switch (self) {
.GET, .HEAD => true,
.POST, .PUT, .DELETE, .CONNECT, .OPTIONS, .TRACE, .PATCH => false,
else => false,
};
}