There are various reasons to your page loading for the first time call will get slow.
The first request to a publication requires downloading & parsing of a lot of binary files with publication configuration after that page and used images and components links resolving calls for that page.
To gain the performance caching is important to enable in your implementation.
There are various optimization and checks you can do for performance in DXA
- Enable DXA Java web applications caching by modifying the cd_client_conf.xml and ehcache.xml files, It's time-based caching keep it at least some 3 to 5 mins based on your business requirements.
- Enable output caching (Not sure DXA 1.8 has output caching option)
- Make sure your binaries CSS, images, and js are getting cached(max age) in a browser, it could be a big performance impact as each binary request also go to your code which does modification check validation before serving the binary
- To enable Tridion Content Service caching by updating your cd_stroage_config.xml, as shown below
<Policy Type="LRU" Class="com.tridion.cache.LRUPolicy">
<Param Name="MemSize" Value="16mb"/>
<Feature Type="DependencyTracker" Class="com.tridion.cache.DependencyTracker"/>
Then for each item, you would like to store in cache, you should also set
<Item typeMapping="Page" cached="true" storageId="defaultFile"/>
You may also wish to consider MemSize, For Invalidating the Content Service caching either you can use Cache Channel service or JMS Active MQ
- You may wish to consider using CDN caching for your web application in production.
- Or else consider to migrating to DXA 2.0, SDL released DXA 2.0 part of this new version is a new REST service called the model service, which is able to return content quicker, and in a leaner R2 format. Not only that, the model service is also able to resolve links in the content on the fly. This is an important performance improvement, because link resolving is one of the most expensive operations in DXA.
I hope it helps