Caching API response on dispatcher | Community
Skip to main content
Level 4
August 11, 2016

Caching API response on dispatcher

  • August 11, 2016
  • 1 reply
  • 2288 views

Hi All,

I am integrating AEM with Hybris. On product page I make an API call to Hybris to get product data which returns response in form of JSON.

As my product data would not change much so I want to cache the JSON response on dispatcher. How in my code I can make sure that when product data is requested it is served from dispatcher and no call goes to Hybris if it is cached if not cached my code should make the API call. Please can someone give pointer configuration and approach required to achieve this use case

Thanks,

Shehjad

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

antoniom5495929
Level 7
August 11, 2016
Hi, it depends on how you are using the api. If you are using a servlet with ajax to get the json and render the data in javascript the dispatcher already cache this json. Otherwise if you are using a model remember that the html of the page is cached on the dispatcher so the call vs hybris is not performed everitime.