Hello, I'm using Ory Identity. My frontend is host...
# ory-network
r
Hello, I'm using Ory Identity. My frontend is hosted on vercel/next.js, my server handler
getServerSideProps
check if the user is authenticated by calling
https://$my-ory-endpoint/session/whoami
. I noticed that the first connection after inactivity is always incredibly slow (1+ secs) and after that everything becomes instant again. I remember asking a while ago (I had the same issue, but on all requests) and now I forward the
cookie
header
client -> vercel -> ory
and the
set-cookie
header
ory -> vercel -> client
so that
__cflb
is always sent. Any way I can debug this issue further?
s
What do you mean by inactivity? Per-user inactivity? Or is it just a dev project you only use some times?
r
I mean per-user inactivity
(We're on the essential plan)
s
where are those requests coming from? 1+s seems like a lot, but it is probably fast due to caching
or do you not have edge caching enabled?
r
Requests are coming from vercel and I have edge caching ("edge sessions" in the console) enabled. I forward the
__cflb
token from the client to ory
(i actually forward all cookies not just
__cflb
)
s
ok and it is for sure a per-user inactivity? so two users will experience that when they log in one after the other?
hm so the vercel server side request is probably coming from US? or do you have any idea of the geo location source?
I can take a look also in our logs, if you send me your project ID or slug
r
So I did the following tests: • from a different browser but same account (it was fast) • from a different computer and different account (it was fast) Our app is not very interactive (users generate an api key and then use it from the command line).
slug is
flamboyant-cori-zs96bdg4le
(it's not secret isn't it?)
s
ok so different account was also fast? then I do know where the culprit is... we'll work on improving that, but it takes a bit of time...
it looks like requests are coming from Virginia/US, but that would only account for 100-200ms max
r
Sounds good. So if people start using their dashboard more often the initial latency will go away?
s
so this is a per-project thing, every few days one request would take quite long, but only for one of your users
r
Ok, thank you for confirming that. I thought I did something wrong
s
we do want to reduce that initial latency, but it will still be there to some extend