Twitter feeds are often just an embedded feed straight from Twitter.
By default, Cloudflare does not cache HTML, as that’s not typically resource-intensive. Just static content like images, CSS, and .js. To cache HTML, you’d have to add a special Page Rule.
If the Twitter content indeed comes from your domain, and you’re trying to cache HTML, the minimum Edge Cache TTL for most free plans is 2 hours.
That page is nicely lightweight. The static files cache well, and the HTML is fantastically compact.
You could even have Cloudflare cache the twitter.php HTML, which would lighten the load even more, but it’s best left alone for now.
The bigger concern is Matomo. If your site gets hammered, and you’re collecting stats with Matomo, that might strain your server. That’s the part you’ll have to keep an eye on, and Cloudflare caching can’t help with.
I appreciate the kudos… I worked hard on keeping it lightweight.
I know about the issue with my tracking and will remove it.
My main concern is the “Reddit” effect. I expect lots of traffic at once. Back to my original question… how can I setup CloudFlare on this page to update every 10 minutes or so? Can you point me in the right direction (tutorial) for this? I know just enough about this stuff to be dangerous (but my main skill is advertising).
Then there’s no need for a 10 minute refresh. If you want to cache your page’s lightweight HTML that’s served from your domain, you can add a Page Rule:
The audience I am targeting are glued to the news. They want to be the first to discover news stuff on Twitter. This is why I was hoping to have the freshest content (within 10 minutes posted on Twitter)… does it make more sense for me not to cache?
Your page is just a window frame for the twitter feed. Like a window frame, you can’t freeze what’s going on outside the window. It’s always changing.
But if you want to make your window frame stronger, cache it. The scene outside won’t be affected either way, but it would suck if the frame breaks and ruins the view.