Subject: Re: [http-extensions] field-name cardinality (#108)

From: HTTP issue updates <[email-masked]>
Date: Tue, 10 Nov 2015 21:04:12 -0800

My initial thought is that the difference in efficiency is going to be extremely minor, and it *might* be useful to specify a header field name more than once (especially if we do something interesting WRT or in #104.

@zwoop WDYT?

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-155667477

---

From: HTTP issue updates <[email-masked]>
Date: Wed, 11 Nov 2015 15:59:30 -0800

The idea behind #104 is that `user-agent=(x|y|z)` is really easy to express:

> User-Agent; substr=x; substr=y; substr=z

... while `user-agent=(x|y) & z` is also reasonable:

> User-Agent; substr=x; substr=y, User-Agent; substr=z

... but note that `user-agent=(x&y) | z` is impossible with that syntax.

So, I think the question is whether this hits the use cases reasonably well; if not, we'll need to re-think.

(And yes, this really belongs in #104).

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-155948808

---

From: HTTP issue updates <[email-masked]>
Date: Wed, 11 Nov 2015 16:25:20 -0800

> I don't think that infinitely complex composition of logical is a goal we should be aiming for

+1

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-155956148

---

From: HTTP issue updates <[email-masked]>
Date: Thu, 12 Nov 2015 14:58:23 -0800

Yeah, just matching against all duplicates would be easier. It'd be nice'ish if people avoided it :).

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156263718

---

From: HTTP issue updates <[email-masked]>
Date: Thu, 12 Nov 2015 16:44:25 -0800

So, just to make sure I understand what we're proposing here...

- `user-agent;s=x;s=y` - User-Agent =~ x | y.
- `user-agent;s=x;s=y, user-agent;s=z` - User-Agent =~ (x | y) & z
- `user-agent;s=x, cookie;s=y` - User-Agent =~ x & Cookie =~ y

Is that right? Are there any other expressions that are possible via current syntax? Here's an [interesting edge case](http://googlewebmastercentral.blogspot.com/2012/11/giving-tablet-users-full-sized-web.html) that may be worth considering:

> Although both Android smartphones and tablets will include the word “Android” in the user-agent string, only the user-agent of smartphones will include the word “Mobile”. 

In previous incarnation you could handle this with the `n` parameter: `Key: user-agent;s=android;n;s=mobi`. However, with current syntax I don't think it'd be possible to distinguish two entries, one for Android tablet vs smartphone?

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156282164

---

From: HTTP issue updates <[email-masked]>
Date: Thu, 12 Nov 2015 18:00:59 -0800

Looking at the spec again, I think that currently we can't really use multiple instances of a parameter or a header as special syntax; it will complicate things too much. However, we *could* put it in the parameter values themselves.

E.g., right now, if you did:

> Key: user-agent;substr=android;substr=mobi

You'll end up with four "buckets":

1. UA contains both `android` and `mobi`
2. UA contains `android` but not `mobi`
3. UA contains `mobi` but not `android`
4. UA contains neither `android` nor `mobi`

... and it would behave the same way if you did:

> Key: user-agent;substr=android, user-agent;substr=mobi

So, I think that gives you the behaviour you want. 

We *could* add syntax to `match` and `substr` to avoid creating all of the permutations of buckets, e.g.,

> Key: user-agent;substr="android&mobi"

So you'd end up with just:

1. UA contains both `android` and `mobi`
2. Everything else

... but I very much wonder if that's worth the complexity. Thoughts?

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156295114

---

From: HTTP issue updates <[email-masked]>
Date: Thu, 12 Nov 2015 19:15:01 -0800

@mnot unless we could key on something horrible like `"ipad" or ("android" and not "mobi")` we'll never cover all the likely-to-be-requested use-cases; and the complexity for adding just a single operator is probably quite high (more operators ⇒ even more complexity), so the cost-benefit for it isn't great.

Having the multiple buckets gets us there eventually anyway, it just means GalaxyTab and iPad users wouldn't benefit from each others' requests. It's still better than `Vary:User-Agent`, though. (With the added benefit that it (hopefully) makes server operators think a bit more about what resources they send to whom, and why, and how they're cached.)

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156310905

---

From: HTTP issue updates <[email-masked]>
Date: Fri, 13 Nov 2015 09:02:24 -0800

I don't know the background of why "Tablet" is omitted for those devices, but (personally) I agree that we probably should deliver that token in the UA string.. and that we don't have to burden Key with a turing complete language. That said, the "OR" use case applies well beyond UA-sniffing.. e.g. keying on cookie header values, which is a common task for many applications.

re, https://github.com/httpwg/http-extensions/issues/108#issuecomment-156295114: interesting, I guess that approach covers most cases, but the fragmentation is painful. Instead of hijacking `&` inside of the value, would it make sense to define an operator that creates a composite key for all the sub-buckets? e.g. `Key: user-agent;substr=a;substr=b;xyz` where xyz is a token that indicates that all the buckets should resolve to same key? Although, I guess that reduces the whole space to an _and_...? Ugh.

_p.s. to be honest, I guess I didn't read the spec close enough, because my interpretation of substr was that substr=a;substr=b would result in same key if `a | b`._

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156488629

---

From: HTTP issue updates <[email-masked]>
Date: Sun, 15 Nov 2015 16:12:27 -0800

(taking OR discussion back over to #104)

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156878037

---

From: HTTP issue updates <[email-masked]>
Date: Sun, 15 Nov 2015 16:13:27 -0800

I think we can close this with no action; make sense?

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156878089

---

From: HTTP issue updates <[email-masked]>
Date: Sun, 15 Nov 2015 16:22:10 -0800

+1. I think #104 covers the concerns here.

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#issuecomment-156878535

---

From: HTTP issue updates <[email-masked]>
Date: Mon, 23 Nov 2015 16:34:53 -0800

Closed #108 via 7eade4891bb45fdf7391f86245a8e8c7ef77c34d.

---
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/issues/108#event-472744054