: Does servicing an API from a subdomain make your app slower? I have a single-page application (SPA) located in application.com, and I want to serve the API from api.application.com. Since this
I have a single-page application (SPA) located in application.com, and I want to serve the API from api.application.com.
Since this is a Cross-Origin Resource Sharing (CORS) browser application, it will always make OPTIONS requests prior to the actual one. Would this make my SPA twice as slow?
More posts by @Deb1703797
1 Comments
Sorted by latest first Latest Oldest Best
Since your OPTIONS response doesn't actually rely on the same application logic your application does I wouldn't expect it to be twice as slow. If your OPTIONS response does not include an entity-body (only a header response, similar to HEAD) then the data transfer will be quite small and much quicker. But you will still have the latency between your visitor/user and your application server.
Also, I would go with a DNS A record for your sub domain, if not already. If you use a CNAME record it will require an additional DNS lookup to get the IP address for what the CNAME entry is pointed at.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.