Clerk handshake causes slow initial load for NextJS standalone deployment
My NextJS app is deployed as a standalone build on AWS (ECS) - so my middleware is running in the same place as my app. This means that for Clerk to complete a handshake multiple round trips need to be converted before the first byte is downloaded.
I was thinking about solving this by either: A) Adding a viewer request function to handle clerk handshakes, or B) Figuring out how to handle the token refresh entirely on the backend.
Anyone else ever run into this issue?
Attached pics are my very rough understanding of how clerk handshakes work, so please correct me if I'm wrong