Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aren't APIM's inbound policies able to read Redis Cache keys set externally? #115

Open
eugen-nw opened this issue Oct 20, 2023 · 2 comments

Comments

@eugen-nw
Copy link

eugen-nw commented Oct 20, 2023

We have a customer in West Europe and am setting up an APIM instance for them in the Central France region. We're running the REST API and the backend in West US. It takes ~20 seconds for a ~2MB file to travel from West US to Central France. In order to improve that delay, I'm attempting to write the file into a Redis instance that's located in Central France and have APIM's inbound policy read it from Redis and return it right away if present, instead of calling our West US located REST API. I could not get this to work, so am wondering what am I missing or is such a scenario not supported by APIM? A key in Redis is key in Redis and should be readable by any service that has access rights to the Redis instance.

I set the APIM's Managed Identity to have "Redis Contributor" permissions on the Redis instance.

I did find earlier #43 and am caching in the backend using the "2_" prefixed key and lookup in APIM's inbound policy using the bare key. It does not work. I did use VS Code's Azure Cache extension to verify that the "2_" prefixed key is present in the Redis cache.
image

I did add the two highlighted cache operations and do notice in the test call's trace that both are successful. This shows that APIM's policy can use the Redis instance.
image
image

@tomkerkhove
Copy link
Member

Adding @akamenev but as far as I know, we only allow getting APIM-managed cache keys.

@eugen-nw
Copy link
Author

That’d be quite unfortunate. As I am warming up the cache externally, I am setting up the very first call to be fast to return a result. Perhaps a feature for APIM to consider for the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants