The Problem: High Traffic, Constantly Changing Content
Conventional wisdom says a site like Laravel News — with new articles, rotating sponsors, and a live toast notification — can't be cached. Eric Barnes and JMac (Jason McCreary) proved otherwise. Using the Fast Laravel course as a guide and Cloudflare as the delivery layer, they pushed the majority of Laravel News requests to the edge, with spikes reaching 70% cache hit rates.
Start with Your Highest-Traffic Pages
The strategy is straightforward: pull your request logs, rank pages by traffic, and cache from the top down. For Laravel News that meant five pages:
- Home page
- Blog listing page
- Individual article pages
- Community links page
- Recent links page
Once those are cached, the remaining uncached traffic is mostly low-volume sub-pages — a manageable tail.
Three Challenges They Had to Solve
1. Removing Unnecessary Livewire
The site had nearly every section wrapped in a Livewire component, but only the newsletter form actually needed Livewire's reactivity. Everything else was effectively static Blade output. Converting those components back to plain Blade templates was a straightforward refactor that isolated the genuinely dynamic pieces and made the rest of the page cacheable.
2. Keeping Dynamic Pieces Dynamic
Some elements can't be frozen: the toast notification, the newsletter form, and rotating sponsor/partner slots. Because Alpine was already present (as a Livewire dependency), the team added Alpine AJAX and used it to swap those components in after the cached page loads — no full-page dynamism required.
3. Two Caching Layers Competing
Laravel News runs on Laravel Cloud, which has its own Cloudflare-backed edge caching. Running a second Cloudflare layer on top created policy conflicts and made cache purging unpredictable. The solution was to bypass Laravel Cloud's caching rules and manage Cloudflare directly, gaining the same CDN benefits with full control.
Cache Busting When Content Changes
Deploy-time cache busting is table stakes. The harder problem is clearing the cache the moment an article is published or community links are approved. The team wired this into Laravel model events:
// Simplified example — fires on article update
Article::updated(function (Article $article) {
Cache::forget('article:' . $article->slug);
Cache::forget('home');
Cache::forget('blog');
});
Scheduled articles presented a separate challenge. Posts written the night before and set to publish at 9 AM have no updated event firing at go-live — just a published_at timestamp comparison. The fix was to piggyback cache clearing onto an existing command that shares new posts to social media. Worst-case staleness: about five minutes.
It Works on Any Stack
None of this requires Laravel Cloud. JMac runs Laravel Shift on a $5/month DigitalOcean droplet handling ~50,000 requests per day, with the entire public-facing side cached and response times around 20 milliseconds from the edge. The only current limitation is Livewire itself, which relies on session state for reactivity. Inertia, React, and API-driven frontends work without issue.
Key Takeaways
- Prioritize by traffic — cache your top five pages first and work down.
- Audit Livewire usage — components that aren't reactive are just Blade templates waiting to be freed.
- Use Alpine AJAX for islands — swap dynamic fragments in after the cached shell loads.
- Control one CDN layer — competing cache layers create purging headaches; pick one and own it.
- Hook cache busting into model events and scheduled commands — cover both real-time updates and time-based publishing.
- Edge caching is infrastructure-agnostic — a $5 VPS with Cloudflare in front can serve tens of thousands of daily requests at ~20 ms.
Source: How We Cached Laravel News at the Edge with Fast Laravel — Laravel News, June 17, 2026.