Taking more time in generating ics file as servlet response when special characters inside it. | Community
Skip to main content
New Member
August 26, 2022

Taking more time in generating ics file as servlet response when special characters inside it.

  • August 26, 2022
  • 1 reply
  • 969 views

We are using AEM as a cloud service. our requirement is to generate ics file as sling servlet response on click of a button on a page.
Issue: When content inside ICS file has special characters like emdash "", endash "", it takes lot of time to generate and download an ICS file for the first time. On the 2nd hit to the same servlet, response becomes faster as it serves cached content. 

we are not able to reproduce this issue in local AEM environment. This issue is occurring only on cloud environments. 
Below is the code we have which generates ics file as reponse
slingHttpServletResponse.setContentType("text/calendar");
slingHttpServletResponse.setHeader("Content-Disposition", "attachment; filename=event.ics");
slingHttpServletResponse.setCharacterEncoding("UTF-8");
slingHttpServletResponse.setContentLength(teststring.length());
slingHttpServletResponse.getWriter().write(teststring);

We also tried below code with no luck. 
response.getOutputStream().write(teststring.getBytes("UTF-8")) 
Please some one suggest how to fix this issue.

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

1 reply

joerghoh
Adobe Employee
Adobe Employee
August 29, 2022

I don't think that this is related to these characters, but there are other aspects which influence the runtime of this code. 

My first guess is that on your CS environments you have much more content than on your local environment.

New Member
August 30, 2022

Hi @joerghoh , ICS content is an authorable content. we tried with same content in local and in cloud env. Where in cloud env it took more time (more than 2 mins) for ICS file to get downloaded. But in local it is instant. 
When we removed emdash "", endash "" , generation of ics file is quicker. we were able to reproduce this scenario with various other special characters as well.