-
Notifications
You must be signed in to change notification settings - Fork 17
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 headers. #132
Add cache headers. #132
Conversation
c3330ae
to
6e76fc4
Compare
f99866e
to
84f9770
Compare
Changes Unknown when pulling 84f9770 on featureCacheHeaders into ** on master**. |
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.
Looks good. I agree that Etag and last-modified are not necessary to make this addition worthwhile.
=============== ==================== ================ | ||
static_ttl BROKER_STATIC_TTL 604800 (1 week) | ||
discovery_ttl BROKER_DISCOVERY_TTL 604800 (1 week) | ||
keys_ttl BROKER_KEYS_TTL 86400 (1 day) |
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.
Having the key cacheable is nice, though also problematic if combined with the key rotation of #121 (comment). If clients were to really respect the cache (which I doubt any client does, but let's assume) and the rotation happens during the time, validation should fail.
At first I wanted to suggest to you to document that problematic, but since key rotation is external to the broker, I wouldn't know where would be a good place for that. So in the end I'm just leaving this as a comment here.
Changes Unknown when pulling b73a6c4 on featureCacheHeaders into ** on master**. |
I created #134, so we won't forget! :) |
Fixes #41.
The approach here is to just set
Cache-Control: no-cache, no-store
for everything, except when overridden explicitly. The overrides are for static files, discovery and keys, each having a config var.The discovery and keys resources don't set Last-Modified and Etag. I feel like it's more trouble than it's worth?