-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add cache control header option #172
Conversation
029a338
to
8789a81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be any documentation for this feature? It appears to be user-facing.
src/bartholomew.rs
Outdated
.head | ||
.cache_control | ||
.clone() | ||
.unwrap_or_else(|| DEFAULT_CACHE_CONTROL.to_owned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change in behaviour, I think, defaulting to instructing no-cache
instead of not caring? Is that intentional? If so, maybe leave a comment on why?
Should users have a way to omit the cache-control
header instead of using no-cache
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will just make the adding of the header optional.
@itowlson I will add docs to |
Ah, of course, the docs are in a separate repo, as I perfectly well knew. I feebly plead Monday. |
8789a81
to
4ef4ccc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny typo but LGTM!
src/content.rs
Outdated
@@ -50,6 +50,11 @@ pub struct Head { | |||
/// | |||
/// This may result in HTTP headers being altered. | |||
pub content_type: Option<String>, | |||
/// Cache Control header override. | |||
/// | |||
/// The default is to send no cachce control headers. This should only be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The default is to send no cachce control headers. This should only be | |
/// The default is to send no cache control headers. This should only be |
Signed-off-by: karthik2804 <karthik.ganeshram@fermyon.com>
4ef4ccc
to
23ca5e0
Compare
Adds an optional header field to allow the browser to cache the responses.