best way to increase performance | Community
Skip to main content
harsha__
Level 2
June 12, 2017
Solved

best way to increase performance

  • June 12, 2017
  • 15 replies
  • 4281 views

What is the best Way to increase performance in AEM?

I need to call restful services from AEM frequently. I am planning to save the frequently getting response in javax.servlet.http.HttpSession(from request) or Cookie. But confused of which aproach to follow. Need some assistance from who have implemented either in their production systems.

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 Feike_Visser1

Also remember AEM is stateless, so there is no session-failover.

15 replies

smacdonald2008
Level 10
June 12, 2017

If the Rest call returns a different data set - ie - a call to a weather service - you should make the call using Java Restful API ( javax.servlet.http.HttpSession) and display the results.  This will not impact performance.

smacdonald2008
Level 10
June 12, 2017

Also - here is some performance tips -- Performance tuning tips | 6.x

harsha__
harsha__Author
Level 2
June 12, 2017

I see that you prefer session over cookie to store frequently used response.

Thanks for the quick response smacdonald2008

smacdonald2008
Level 10
June 12, 2017

Yeah - its better to develop an AEM service to invoke a 3rd party Restful service - see  --

Scott's Digital Community: Creating Adobe Experience Manager services that invoke third party Restful web services

Feike_Visser1
Adobe Employee
Adobe Employee
June 12, 2017

Overall I would say, see what you can cache. For example in the browser / dispatcher, after this look at optimizing the code.

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
June 12, 2017

Also remember AEM is stateless, so there is no session-failover.

harsha__
harsha__Author
Level 2
June 12, 2017

Thanks Mac. you are very helpful

harsha__
harsha__Author
Level 2
June 12, 2017

feike_visser no Session-failover in AEM means, AEM user session will be lost if any publish server in the publish network is lost? if this is the case with AEM then storing response in session is not a good idea right? please help me make a better choice between cookie or javax.servlet.http.HttpSession(from request as attribute) for my application.

harsha__
harsha__Author
Level 2
June 13, 2017

smacdonald2008 feike_visser Can you help me with my last query?

smacdonald2008
Level 10
June 13, 2017

"restful services from AEM frequently"

Use Java code like:

DefaultHttpClient httpClient = new DefaultHttpClient();

            

  HttpGet getRequest = new HttpGet("http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver%20BC&destinations=San%20Francisco&sensor=false");

  getRequest.addHeader("accept", "application/json");

  HttpResponse response = httpClient.execute(getRequest);