Re: [w3c/ServiceWorker] Need to explain name matching rules for cache names (#1483)

> The following comment was made by @aphillips in response to the following question by @jakearchibald: "Is there an example of a spec that does the right thing here. The intent is for the match to be case sensitive."

##

Lots of specs "do the right thing", but the first problem is that there are choices you need to make in defining what "the right thing" is.

Given what you are doing and the simplicity of the instructions provided, I think what you mean here goes beyond case sensitivity: the `cacheName` value is expected to be an identical sequence of Unicode code points to the `key`. What you should do is define the term 'matches' and then use it for string comparison. For an example of this, see HTML:

https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitivity-and-string-comparison

Which says:

> Comparing two strings in a case-sensitive manner means comparing them exactly, code point for code point.
> Except where otherwise stated, string comparisons must be performed in a case-sensitive manner.

This presumes that:

* `cacheName` and `key` do not include any character escapes and that they are normal DOMStrings.
* You do not intend Unicode normalization to influence the matching (we recommend that you do not use Unicode normalization here)

Our document [Charmod-Norm](https://www.w3.org/TR/charmod-norm) hopefully provides explanation in case you are curious why you might want to do something different.




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1483#issuecomment-545500338

Received on Wednesday, 23 October 2019 15:29:25 UTC