Set appropriate caching rules for https://sitesuggest.mozillalabs.com

RESOLVED WORKSFORME

Status

Infrastructure & Operations Graveyard
WebOps: Labs
RESOLVED WORKSFORME
5 years ago
a year ago

People

(Reporter: Mardak, Unassigned)

Tracking

Details

(Reporter)

Description

5 years ago
(In reply to C. Liang [:cyliang] from comment #1)
> Requests are cached for 10 minutes.
Can this caching be done on a per-special-header basis? We're changing the content based on a "Category: xyz" header. Caching the result for a given..

curl -H "Category: sports" https://sitesuggest.mozillalabs.com

should be fine in general. The output actually is random, but a 10 minute cache is fine as the client will be caching as well and using different categories.
Your application needs to send out a 

Vary: Category

header and the cache will know what to do.
But really, that header should be X-Category.
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44 for more details
(Reporter)

Comment 4

5 years ago
I seem to be doing something wrong? because this isn't working:

curl -H"Category: sports/hockey" -H"Vary: Category" https://sitesuggest.mozillalabs.com

curl -H"Category: sports/baseball" -H"Vary: Category" https://sitesuggest.mozillalabs.com
(Reporter)

Comment 5

5 years ago
Oh, the documentation says "The Vary field value indicates the set of request-header" but it seems like this should be a response header?
(Reporter)

Comment 6

5 years ago
Updated the server code to respond with "Vary: Category" (without the X- prefix, see http://tools.ietf.org/html/rfc6648 ) Although I don't think we're really looking to standardize this category header...
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WORKSFORME
Product: mozilla.org → Infrastructure & Operations
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.