It is actually weird to me that it works on your fresh install with WP Rocket enabled. While I don’t know WP Rocket, I’d expect it to cache the page completely including the code for the counter.
If I look at your main site, I see this when I view the source of your page:
<!-- This website is like a Rocket, isn't it? Performance optimized by WP Rocket. Learn more: https://wp-rocket.me - Debug: cached@1606293240 -->
I don’t see this in your fresh install.
Is that code for the counter same as the shortcode you pasted above in your previous replies?
Can I understand what you mean by custom codes?
I googled a bit and WP Rocket doesn’t support fragment caching so you’ll ajax to display the count live.
One thing I am thinking of is to just use:
<?php echo_tptn_post_count(); ?>
You have the setting to always display the latest count active which is positive.