0

I am trying to access an existing Azure Cache for Redis instance from a GET operation on APIM.

The cache content looks like this: enter image description here

This is the policy I use to access the data: enter image description here

When I test it on APIM, the Trace window shows this: enter image description here

The prefix "2_" is actually the piece that causes an issue for me right now, as I am unable to use my Redis instance. It seems it is dynamically added by APIM. So far, I was unable to find any official documentation that explains this behavior.

Does anyone have any idea about anything related to this topic ?

Julien
  • 437
  • 4
  • 11

1 Answers1

1

The format of Redis cache key and its name are not documented and should not be relied upon. At the moment it is prefixed to achieve better reliability and cache performance when internal cache implementation changes and effectively denotes format of the data.

If you need to manipulate cache context of active API calls consider creating a new API in APIM that you would use to manipulate cache content and use existing caching policies to do so.

Vitaliy Kurokhtin
  • 7,205
  • 1
  • 19
  • 18
  • Thanks for the answer. In the end, I used a Microservice to retrieve the data, and cache it if it was not present during a GET call. This way, it's not necessary to create another API to manipulate the cache content. – Julien Jul 15 '22 at 23:34