简体   繁体   English

当我通过邮递员访问服务时,缓存调解器不起作用 - WSO2 - MI

[英]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).我在代理内部使用缓存中介,该代理我正在调用内部序列(我需要将缓存用于多个 API,这就是我在序列内部调用该代理的原因)。 then I am calling into the rest API.然后我调用了其余的 API。

Issue: when I am hitting the rest API services through postman, cache is not working.问题:当我通过邮递员访问其余 API 服务时,缓存不起作用。

the same services I am hitting from SoapUI, cache is working fine(second time onwards the response is coming from cache storage).我从 SoapUI 访问的相同服务,缓存工作正常(第二次之后响应来自缓存存储)。

it's chrome also it's working.它是 chrome 也可以正常工作。

I believe Postman sends a random token in every request.我相信 Postman 在每个请求中都会发送一个随机令牌。 Postman-Token: <Token> . 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/>要解决此问题,请在<headersToExcludeInHash/>下的缓存中介配置中添加“Postman-Token”标头

https://docs.wso2.com/display/EI660/Cache+Mediator 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).我在代理内部使用了缓存介体,该代理正在调用内部序列(我需要在几个API中使用缓存,这就是为什么我在序列内部调用该代理的原因)。 then I am calling into the rest API.然后我调用其余的API。

Issue: when I am hitting the rest API services through postman, cache is not working.问题:当我通过邮递员访问其余的API服务时,缓存不起作用。

the same services I am hitting from SoapUI, cache is working fine(second time onwards the response is coming from cache storage).与我从SoapUI命中的服务相同,缓存工作正常(第二次以后,响应来自缓存存储)。

it's chrome also it's working.它是镀铬的,而且还在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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