3 ms·
You could also set up a cookie-free domain and have your static assets accelerated by the CDN while keeping your files (which send cookies) on a separate domain
by CodyA 11y ago
You could also set up a cookie-free domain and have your static assets accelerated by the CDN while keeping your files (which send cookies) on a separate domain.
You can still use a CDN in this case however, by default files with cookies cannot be cached on a CDN's edge servers. Some CDNs have the ability to exclude the cookie from the static file such as KeyCDN which allows you to ignore the cookie and/or strip it entirely (https://www.keycdn.com/support/pull-zone-settings/ https://www.keycdn.com/support/pull-zone-settings/). This ensures that your file is now cacheable which is important for instance if you are using Cloudflare which adds a Set-Cookie header to domains routed through them.