1

I am facing an issue while configuring Response cache.

I have configured response cache at my local system by using the following link https://docs.wso2.com/display/AM200/Configuring+Caching. But when i hit an API request from rest client it is still sending request to the backend server (legacy app). I am using WSO2 API Manager 2.x

Thanks Raju K

1

2 Answers 2

0

It should work. Make sure you enabled Response Caching in publisher UI for that particular API. To confirm it's done correctly, have a look at API synapse file in repository/deployment/server/synapse-configs/default/api/. It should have cache mediator like this.

     <cache scope="per-host"
            collector="false"
            hashGenerator="org.wso2.caching.digest.REQUESTHASHGenerator"
            timeout="300">
        <implementation type="memory" maxSize="500"/>
     </cache>
1
  • Thank you Bhathiya
    – Raju K
    Jan 2, 2017 at 5:34
0

I have changed the code in api_home\repository\resources\api_templates\velocity_template.xml

now it's working fine.

2
  • 1
    <cache timeout="$!responseCacheTimeOut" scope="per-host" collector="false" hashGenerator="org.wso2.caching.digest.DOMHASHGenerator"> <implementation type="memory" maxSize="500"/> </cache>
    – Raju K
    Jan 2, 2017 at 7:12
  • i suppose it should be gateway component?
    – Vivek
    Apr 30, 2020 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.