-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support language variants for summary and mobile content #1010
Conversation
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.
Neatly done!
Now that we implement no-store
on the bucket level, we also need to normalise the cache-control
header for all incoming requests to RESTBase, though, as we don't want that a client sends it to us. Basically something like:
if (mwUtil.isNoCacheRequest(req)) {
req.headers['cache-request'] = 'no-cache';
} else {
delete req.headers['cache-request'];
}
@@ -145,15 +145,16 @@ paths: | |||
request: | |||
method: put | |||
uri: /{domain}/sys/key_value/page_summary/{request.params.title} | |||
headers: '{{merge({"if-none-hash-match": "*"}, extract.headers)}}' | |||
headers: '{{merge({"if-none-hash-match": "*"}, extract.headers, "cache-control": request.headers.cache-control)}}' |
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.
Why is the request's cache-control
being added here and below?
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.
@d00rman to pass through the no-store
header.
70b6821
to
aef1901
Compare
e19656a
to
23e8698
Compare
Doesn't Varnish strip those headers? |
Change-Id: I4901a437444f3805bbca82df1b1a3c66c41a3d96
Change-Id: Iff004aefb21f43bc530a0ad2cf658baddebf5011
Change-Id: Ibca5c9c654a568348454aea6f1bed8aa10f087a4
Change-Id: Ibde9d24247ba202f64d6bb69ce7b08ad791b40e0
Change-Id: I1bb5fbf6edfb9524c6969efe23cde766be2c39e2
23e8698
to
193229d
Compare
Rebased |
All the dependencies were deployed, so we're ready to go fowrward with this. |
Yes, Varnish does, but what about internal clients? Better safe than sorry. EDIT: Also, what about installs that don't count on Varnish being there? The smaller the number of assumptions, the better IMHO |
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.
Two nits, and let's also strip no-store
frm incoming requests. To be more precise, let's only leave no-cache
and get rid of everything else.
v1/summary.yaml
Outdated
catch: | ||
status: 412 | ||
status: [ 412, 202 ] |
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.
Nit: let's sort these numbers.
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.
Done
v1/summary.yaml
Outdated
return_if: | ||
status: 412 | ||
status: [ 412, 202 ] |
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.
Idem.
Change-Id: I4c1e78be374de1f0723d870f09ca1cb98ee7a156
lib/normalize_headers_filter.js
Outdated
module.exports = function normalizeHeaders(hyper, req, next) { | ||
if (mwUtil.isNoCacheRequest(req)) { | ||
req.headers['cache-control'] = 'no-cache'; | ||
} else { |
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.
Nit: else if (req.headers && req.headers['cache-control'])
(I wonder if this is needed, i.e. is there somewhere where we ensure the existence of the headers hash?)
Change-Id: I5de0e5b81521f64acee7bc2cab0fe4db2773ef44
3a72534
to
9d9ff96
Compare
cc @wikimedia/services @berndsi