5 ms·
Some people have performance concerns with CORS is the main reason I believe. The overhead is an extra round trip.
by tinco 8y ago
Some people have performance concerns with CORS is the main reason I believe. The overhead is an extra round trip.
- atonse 8y agoI thought the concern was security. Anyway HTTP2 would hopefully address that (through header compression), and things like zero-RTT TLS and keep-alive further minimize the overhead of an additional request. Plus doesn't CORS only make preflight requests periodically, not for every request?
- luhn 8y agoPreflights are cached, but because CORS is per-URL caching can be of limited value. If your API uses `/info` and `/edit`, a preflight request has to be made for both (assuming a preflight is necessary). If your application has dynamic URLs (e.g. `/widget/1`, `/widget/2`, etc.) the problem is exacerbated even further.
- Ayesh 8y agoI wrote/research a lot about http/2, and even has a small tool for it (https://http2.pro https://http2.pro). Among many things you get from http/2, it cannot eliminate round trip time. Sure, you can keep a connection alive but that's possible with http 1.1 too. Header compression is HPACK. If the header changes even the slightest bit, it's not cached. Dynamic URLs and headers can easily bust HPACK compression.