Hey, I'm trying to follow <https://www.ory.sh/docs...
# ory-network
a
Hey, I'm trying to follow https://www.ory.sh/docs/concepts/cache#force-refresh to force cache refresh and I'm having some issues. 1. using exactly
Copy code
ory.toSession(undefined, undefined, {
  headers: {
    "Cache-Control": "max-age=0",
  },
})
raises an error
Expected 0-2 arguments, but got 3.ts(2554)
2. using
Copy code
ory.toSession(undefined, {
  headers: {
    "Cache-Control": "max-age=0",
  },
})
seems to work as expected - I can see the cache-control header in the request. But the request results in a CORS error: "Cross-Origin Resource Sharing error: PreflightMissingAllowOriginHeader". This is for development for now, we're connecting to Ory through the Ory Tunnel. Would you have any pointers? We have a use-case where we want to set the cache expiration to be a bit more conservative than your defaults, so this would be a pretty useful capability to have.
Even if trying to connect directly to Ory using
fetch
, setting that extra header seems to be problematic: