Free Support Forum -

First call of the component is slow

I use Words in the web application to dynamically generate PDF document from the Word template. This operation takes ca. 15 seconds when page is visited for the very first time, after that documents are generated in ca. 4 seconds. After long time of users inactivity (1-2 hours), again first visitor have to wait ca. 15 sec for his document.

I believe this problem may not be directly related to the Aspose product itself, but rather to configuration of the IIS/Windows server, which probably removes component from the memory after certain inactivity and then have to load it again.

Do you have any tips how to change server configuration to avoid such behavior?

Hi Marcin,

Thanks for your inquiry. Yes, this is an expected behavior i.e. the first time after IIS is restarted, rendering a Word document to PDF takes more time than any subsequent conversions. Aspose.Words needs to pre-cache fonts and other resources for rendering. This only happens for the first conversion. If you want to do this pre-caching earlier then you can simply call doc.UpdatePageLayout() on an empty document before converting Word to PDF. I hope, this helps.

Best regards,

A post was merged into an existing topic: Saving to PDF first time is slow