简体   繁体   中英

Cache mediator is not working when I hit the services via postman - WSO2 - MI

I am using a cache mediator inside the proxy, that proxy I am calling the inside sequence(I need to use cache into several API that's why I am calling that proxy inside sequence). then I am calling into the rest API.

Issue: when I am hitting the rest API services through postman, cache is not working.

the same services I am hitting from SoapUI, cache is working fine(second time onwards the response is coming from cache storage).

it's chrome also it's working.

I believe Postman sends a random token in every request. Postman-Token: <Token> . Cache mediator works by checking the headers and payload of the request. When a random header value is sent every time, cache mediator will diagnose it as a different request. Hence the response won't be served from the Cache.

To overcome the issue add the "Postman-Token" header in the cache mediator configuration under <headersToExcludeInHash/>

https://docs.wso2.com/display/EI660/Cache+Mediator

I am using a cache mediator inside the proxy, that proxy I am calling the inside sequence(I need to use cache into several API that's why I am calling that proxy inside sequence). then I am calling into the rest API.

Issue: when I am hitting the rest API services through postman, cache is not working.

the same services I am hitting from SoapUI, cache is working fine(second time onwards the response is coming from cache storage).

it's chrome also it's working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM