Vivek Shukla
thevivekshukla.bsky.social
Vivek Shukla
@thevivekshukla.bsky.social
Software Engineer
Otherwise the best solution is too host both SPA and api server on the same host. For this you use web server like nginx.
February 8, 2025 at 2:34 PM
However this has very bad impact on the performance, you are practically making 1 extra request for each actual request.
One remedy you can take is to add Access-Control-Max-Age header. Which will tell browser to cache the request for that much seconds.
February 8, 2025 at 2:34 PM