We are implementing a project using AEM 6.2 version. We are having both static & dynamic components on the page.
We are looking for option to build our components such way that entire page will be cached except the dynamic component sections(these dynamic components should render the content dynamically)
Can you anyone please let me know what will be the best solution to achieve this.
Thanks in advance.
To cache AEM pages - you use Dispathcer. See:
In AEM 6.2 - its recommended that you build your components using Sightly.
So what controls caching is how you configure Dispatcher - not how you build components.
This  does exactly what you need and works great. Also see .
You can do it a number of ways, including by specifying a configuration in AEM for the resourceTypes to target. It's pretty neat.
In order to accomplish a combination of static & dynamic content, You must use Sling Dynamic module. Here is the doc.
https://www.cognifide.com/our-blogs/cq/sling-dynamic-include/ (Excellent Read)
Using the sling dynamic module, You can make sections of the page non-cachable in your case it is body of the page.
Thanks and Regards