4 ms·
Is it better to use two different domains for API and static content then, in order for cookies to be only sent to the API domain/subdomain? That way, if there
by kevindqc 10y ago
Is it better to use two different domains for API and static content then, in order for cookies to be only sent to the API domain/subdomain? That way, if there are requests to the static content that's served by a CDN (ie: Cloudflare), it won't contain sensitive cookie information?
- michaelmior 10y agoThis is good practice anyway because it avoids the overhead of sending cookies for static content when they're not needed.
- dylz 10y agoCloudflare forces a cfduid cookie no matter what, even on pure-static-caching
- michaelmior 10y agoThis would still save you having to send all other cookies from your non-static domain.
- dc2447 10y agoIn HTTP2 the opposite is true. Single domain will help you with performance
- Buge 10y agoActually with http2 you can multiplex requests for multiple domains within a single connection. As long as the DNS for the domains is the same IP, and you have a single certificate covering both domains.