Yes—there are a few ways to reduce direct calls to /sessions/whoami, including with Oathkeeper, but there are trade-offs. Options: - Use Oathkeeper as the gate and avoid per-request whoami in your app: - Configure Oathkeeper’s cookie_session (or bearer_token) authenticator to call /sessions/whoami. Your upstream app then trusts Oathkeeper’s decision and does not need to call whoami itself on every request. This shifts the validation load from your app to Oathkeeper. [[Zero Trust guide](
https://www.ory.sh/docs/kratos/guides/zero-trust-iap-proxy-identity-access-proxy#configuration); [WebSockets rules](
https://www.ory.sh/docs/oathkeeper/guides/proxy-websockets#configure-ory-oathkeeper-and-ory-kratos)] - Caveat: Oathkeeper will still call whoami for its own checks. If you generate high request rates, you can hit Ory Network rate limits, and Oathkeeper can surface 401s when upstream whoami returns 429. [[Issue 1167](
https://github.com/ory/oathkeeper/issues/1167)] - Add short-lived caching at Oathkeeper: - There’s an open request to add caching to cookie_session to mitigate bursts; currently, this is not built-in, so Oathkeeper may call whoami per request. [[Issue 1167](
https://github.com/ory/oathkeeper/issues/1167)] - Workarounds today include reducing parallelism or using a different pattern below. - Use Session-to-JWT to reduce whoami calls: - Convert the session to a JWT via toSession with tokenize_as, then validate that JWT at your edge/app without calling whoami each time. This is explicitly recommended to reduce repeated calls. [[Session to JWT](
https://www.ory.sh/docs/identities/session-to-jwt-cors); [JWT support](
https://www.ory.sh/docs/kratos/session-management/overview#json-web-token-jwt-support)] - You can also have Oathkeeper convert sessions to JWTs using its mutators and then validate the JWT for subsequent requests, further cutting whoami traffic. [[JWT support](
https://www.ory.sh/docs/kratos/session-management/overview#use-ory-oathkeeper-to-convert-sessions-to-jwts)] - Leverage Edge Sessions caching if you must call whoami: - Ory Network’s edge cache makes whoami fast and eventually consistent; you can tune cache TTL or force-refresh with Cache-Control headers when necessary. This doesn’t reduce calls, but it reduces latency and lets you balance freshness. [[Edge Sessions](
https://www.ory.sh/docs/concepts/cache); [Force refresh](
https://www.ory.sh/docs/concepts/cache#force-refresh)] - Backend pattern without Oathkeeper: - If your backend validates sessions itself, forward cookies to toSession per request (best practice), or use an in-memory cache with a short TTL to cut duplicate validations during bursts. This pattern is suggested as a workaround in rate-limit discussions. [[Integrate backend](
https://www.ory.sh/docs/migrate-to-ory#integrate-backend); [[Issue 396](
https://github.com/ory/network/issues/396)] In short: Oathkeeper can help you avoid calling whoami from your app, but without additional caching it will still call whoami per request. To truly reduce calls, use Session-to-JWT (via Ory or via Oathkeeper’s JWT mutator), or introduce brief caching at the proxy layer. [[Issue 1167](
https://github.com/ory/oathkeeper/issues/1167); [Session to JWT](
https://www.ory.sh/docs/identities/session-to-jwt-cors)]