https://tyk.io/docs/context-variables/
If not using a Tyk Dashboard, add the field enable_context_vars to your API definition file at root level and set it to true.
Also per this doc, it should be β_β not β-β here $tyk_context.headers_X-Tyk-Cached-Response
Also - this context variable is for the request values, not response:
Context variables are extracted from the request at the start of the middleware chain, and must be explicitly enabled in order for them to be made available to your transforms.
You cannot access headers in the response context, only in the request context, but you CAN refer to the request context in the response headers middleware.
Hello Yaara,
I read the first one, we wrote more or less at the same moment the second comment.
THe format of the header was wrong
Sure, I realized the format some days ago and I changed.
You cannot access headers in the response context, only in the request context, but you CAN refer to the request context in the response headers middleware.