dispatcher cache servlet request ? | Community
Skip to main content
New Participant
October 16, 2015
Solved

dispatcher cache servlet request ?

  • October 16, 2015
  • 2 replies
  • 1129 views

Hello,

Can the dispatcher be configured to cache requests to custom servlets?  Is this standard practice?

Is it typical for the dispatcher to cache publish instance requests to custom servlets that return a JSON repsonse?

Thanks

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

Hi,

You would normally use a servlet to return data based on your arguments. As such the request would never be cached. 

Taking your use case, you want a servlet response to be cached, in which case this sounds like reference data, because it is being cached and will not change. In this scenario why not store this content in a node and use a component to generate the output required?

Regards,

Opkar

2 replies

ogillAccepted solution
Employee
October 16, 2015

Hi,

You would normally use a servlet to return data based on your arguments. As such the request would never be cached. 

Taking your use case, you want a servlet response to be cached, in which case this sounds like reference data, because it is being cached and will not change. In this scenario why not store this content in a node and use a component to generate the output required?

Regards,

Opkar

Techaspect_Solu
New Participant
October 16, 2015

Generally as the servlet response depends on the input which will be sent to the servlet and so it generates the response based on the input that servlet received and it is dynamic. It is not a good practice to cache the dynamic response.