5 ms·
Chrome imposes a limit of 2h on Access-Control-Max-Age (other browsers may differ). Anyway, today we have the tools to expose different backends through the sa
by wereHamster 5y ago
Chrome imposes a limit of 2h on Access-Control-Max-Age (other browsers may differ).
Anyway, today we have the tools to expose different backends through the same domain. Reverse proxies, k8s ingress, … a separate domain may not add much value in most situations.
- berkes 5y agoEven then, most often your backend API service runs off one domain, so it needs only one OPTION request ever two hours for the user session. If your users make only one request per two hours, that still doubles the requests, so in that case caching'll hardly help. But in more typical cases, where one session does 20+ requests, it's a meagre 5% of the requests. In which case 'resolving that n+1 request' or 'speeding up that 1200ms response' is far better low hanging fruit than removing the single OPTIONS request. It depends on your case, though.
- franga2000 5y agoSubdomains absolutely have value! It doesn't matter that we have those tools "today" (it's not like we didn't have reverse proxies many years ago), different domains are still the only way to truly split up traffic. A reverse proxy by definition doubles your total bandwidth requirement, which is expensive and inefficient if you aren't running everything in one datacenter. You'd need to not only get servers with enough bandwidth to cover their traffic, but another server with the sum of all individual server bandwidths to handle proxying. And if you want to do geographic sharing, you either need to shard all services, or be fine with an increase in latency for non-sharded services.