There is no specific filter or action for that. The cache is built upon GET request. A page is requested, the page is built the normal WordPress way, the result is stored in a cache file or in memory (depending on what method you use). The page is cached as a visitor will see the website. If you want some dynamic content to have something like products you viewed before, you should use fragment cache as that part of the page will not be cached. Fragment cache is something like this:
<!--mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> -->
echo 'The time is '.date( 'H:i:s', time() );
<!--/mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> -->
where YOUR_CODE is defined in your wp-config.php file and should be something unique so hackers will not be able to use it.