Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Caching response from servlet

Avatar

Avatar
Validate 25
Level 3
Jai1122
Level 3

Likes

21 likes

Total Posts

127 posts

Correct Reply

2 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Jai1122
Level 3

Likes

21 likes

Total Posts

127 posts

Correct Reply

2 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Jai1122
Level 3

01-12-2016

Hi Experts,

  We have two ways of registering a sling servlet

  1. Registering through path
  2. Registering through resource type.

Say we use the second option, I have a page component /sampleproject/page/homepagecomponent and i register a servlet using this component. This means whenever i access a page created using this component(/content/home.html) the servlet will get invoked and the response from the servlet will be used to render the page. It does not matter whether the call is from the browser or it is an Ajax call. 

If my above understanding is correct can we cache the response from the servlet in dispatcher through this option? Usually say we use something like /bin/myservlet as path for servlet, in disptacher we will allow this path to hit the publish instance and we will not cache it. I am trying to cache the response from the servlet as well. Please help me with your inputs.

Thanks,

Jai.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct Reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

01-12-2016

You can only cache responses that have an extension.

See here more detailed info: https://docs.adobe.com/content/docs/en/dispatcher.html

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 7
Jitendra_S_Toma
Level 7

Likes

71 likes

Total Posts

615 posts

Correct Reply

84 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 7
Jitendra_S_Toma
Level 7

Likes

71 likes

Total Posts

615 posts

Correct Reply

84 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Jitendra_S_Toma
Level 7

01-12-2016

Hi,

That's one way to cache the response from servlet. Another way is that you have to use /bin/servlet.json or html and also allowed this path at the dispatcher level.

Regards,

Jitendra