简体   繁体   English

如何使用wso2 ESB缓存RESTful请求和JSON响应

[英]how to cache RESTful requests and JSON responses using wso2 ESB

what wso2 mediator and package classes implement JSON/REST/HTTP friendly caching? 什么wso2介体和程序包类实现JSON / REST / HTTP友好缓存? For example, read HTTP headers and URIs to identify cache keys on GET commands, parse JSON (instead of XML) to invalidate cache entry on collection POSTs (with key in payload), and conform with standard HTTP/1.1 header scheme (ie https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html ) ?? 例如,读取HTTP标头和URI以标识GET命令上的缓存键,解析JSON(而非XML)以使集合POST上的缓存条目无效(带有有效载荷中的键),并符合标准的HTTP / 1.1标头方案(即https: //www.w3.org/Protocols/rfc2616/rfc2616-sec13.html )??

You can use Cache Mediator from WSO2 ESB. 您可以从WSO2 ESB使用Cache Mediator

<sequence name="SEQ_CACHE">
  <in>
    <cache scope="per-host"
      collector="false"
      hashGenerator="org.wso2.caching.digest.DOMHASHGenerator"
      timeout="20">
      <implementation type="memory" maxSize="100"/>
    </cache>

    <send>
      <endpoint>
        <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
      </endpoint>
    </send>
  </in>

  <out>
    <cache scope="per-host" collector="true"/>
    <send/>
  </out>
</sequence>

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

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