kind-sundown-43010
10/18/2022, 10:13 AMGET /whoami
responses…kind-sundown-43010
10/18/2022, 10:15 AMkind-sundown-43010
10/18/2022, 10:16 AMfast-lunch-54279
high-optician-2097
high-optician-2097
/session/whoami
inbetween?
We released a new feature to production yesterday which significantly decreases latency in any world region. The downside is that changes from the admin API are not immediate but instead eventually consistent.
We have a new feature in the pipeline which allows the client to decide how old the content can be using Cache-Control: max-age=0
. This is not yet rolled out but will be rolled out by end of day.high-optician-2097
high-optician-2097
kind-sundown-43010
10/18/2022, 10:21 AMPUT /admin/identities/{id}
would signal success but the result isn’t immediately reflected in GET /sessions/whoami
?high-optician-2097
/session/whoami
can in some cases be stale. The second request to the endpoint will always be fresh (unless you’re requesting them too quickly after one another). By tomorrow you can do:
GET /session/whoami
Cookie: the-cookie
Cache-Control: max-age=0
and it will always return a fresh response, but it also will be slowerthankful-dog-96817
10/18/2022, 10:23 AMkind-sundown-43010
10/18/2022, 10:23 AM/sessions/whoami
(about 2 seconds after the request to BE completed) and the metadata is not updatedhelpful-table-77025
10/18/2022, 10:23 AMcan in some cases be stale...which wasn't the case before yesterday, and our FE relies on
metadata_public
to know if we created our own identity related to this Ory instancehigh-optician-2097
thankful-dog-96817
10/18/2022, 10:25 AMhigh-optician-2097
high-optician-2097
kind-sundown-43010
10/18/2022, 10:30 AMkind-sundown-43010
10/18/2022, 10:31 AMhigh-optician-2097
max-age=0
an acceptable solution for ya’ll to ensure that the cache isn’t stale? It’s basically the same behavior as the API had prior. You can control how old the cache should be using e.g. Cache-Controle: max-age=60
which would say that you’re fine if the session cache is 60 seconds old and if it is older the server should revalidate.
Generally, we always revalidate the cache in the background, so the second request is always freshthankful-dog-96817
10/18/2022, 10:31 AMhigh-optician-2097
high-optician-2097
helpful-table-77025
10/18/2022, 10:33 AMhigh-optician-2097
helpful-table-77025
10/18/2022, 10:53 AMkind-sundown-43010
10/18/2022, 10:56 AMkind-sundown-43010
10/18/2022, 11:00 AMPOST /self-service/registration
so it gets fed into the webhook but not persisted otherwise…kind-sundown-43010
10/18/2022, 11:02 AMPOST /self-service/registration
request
"registration_props": {
"referral_code": "abcdef"
}
and the webhook would include that data (but not persist it in the identity in any way)high-optician-2097
{identity: { traits: { name: 'asdf' } }}
this would then also be already reflected in the session