簡體   English   中英

如何使用wso2 ESB緩存RESTful請求和JSON響應

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

什么wso2介體和程序包類實現JSON / REST / HTTP友好緩存? 例如,讀取HTTP標頭和URI以標識GET命令上的緩存鍵,解析JSON(而非XML)以使集合POST上的緩存條目無效(帶有有效載荷中的鍵),並符合標准的HTTP / 1.1標頭方案(即https: //www.w3.org/Protocols/rfc2616/rfc2616-sec13.html )??

您可以從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