Cache exclusion in Drupal - Disable cache for certain pages or template
These below code you can put on your template pages, you can apply condition according to requirement so so caching will exclude for those pages where apply this code.
$GLOBALS['conf']['cache'] = FALSE; $GLOBALS['do_not_cache'] = 1;
We can use CacheExclude module to manage caching for perticular page or condition https://www.drupal.org/project/cacheexclude