Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
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.
Solucionado! Ir para a Solução.
Also remember AEM is stateless, so there is no session-failover.
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.
Also - here is some performance tips -- Performance tuning tips | 6.x
Visualizações
respostas
Total de curtidas
I see that you prefer session over cookie to store frequently used response.
Thanks for the quick response smacdonald2008
Visualizações
respostas
Total de curtidas
Yeah - its better to develop an AEM service to invoke a 3rd party Restful service - see --
Overall I would say, see what you can cache. For example in the browser / dispatcher, after this look at optimizing the code.
Visualizações
respostas
Total de curtidas
Also remember AEM is stateless, so there is no session-failover.
Thanks Mac. you are very helpful
Visualizações
respostas
Total de curtidas
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.
Visualizações
respostas
Total de curtidas
smacdonald2008 feike_visser Can you help me with my last query?
Visualizações
respostas
Total de curtidas
"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%20Fr..."
);
getRequest.addHeader(
"accept"
,
"application/json"
);
HttpResponse response = httpClient.execute(getRequest);
Visualizações
respostas
Total de curtidas
smacdonald2008 Thanks for your answer. But I am ok with Restful calling and getting the response code part.
I am looking to save the response in Session or Cookie to avoid hitting the restfull service frequently. but confused about which one to prefer for storing Response, such as should I use Session setattribute to save the respoIse or should i use cookies in browsers to save the response?
Visualizações
respostas
Total de curtidas
If needed you can also cache the response from the rest calls on the backend for example using Guava Cache
AEM sessions are not like J2EE sessions. There are Sessions to the JCR. I would not try to store data there.
In AEM - why use Cookies? If you want to store data from a Restful service - i recommend storing the data in the JCR.
As per our client he wants all the data to be stored used Restful service and not in Jcr.. but for temporary use I am using cookies to store data. I see cookies and Guava Cache has advantages over javax.servlet.http.HttpSession(from request) storage. So will be implementing them. smacdonald2008 Thank you
Visualizações
respostas
Total de curtidas
Thanks rodolfoe61952519 for your suggestion. it seems like a best choice
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas