(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
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
Oh, the documentation says "The Vary field value indicates the set of request-header" but it seems like this should be a response header?
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...