Edge Caching Laravel News with Cloudflare &amp; Fast Laravel | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. How Laravel News Cached a High-Traffic Site at the Edge with Fast Laravel and Cloudflare

   [Laravel](https://www.msaied.com/public/articles?category=laravel) [Tips &amp; Tricks](https://www.msaied.com/public/articles?category=tips-tricks) 

 How Laravel News Cached a High-Traffic Site at the Edge with Fast Laravel and Cloudflare
=========================================================================================

 Eric Barnes and JMac walk through how Laravel News moved from single-digit cache rates to 70% edge-cached requests using Cloudflare, Alpine AJAX, and model-event-driven cache busting.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 17 Jun 2026 · Updated 17 Jun 2026 · 4 min read

ShareCopy linkCopied

 ![How Laravel News Cached a High-Traffic Site at the Edge with Fast Laravel and Cloudflare](https://cdn.msaied.com/229/eadd662a20a8fba744a280b22a2e7a7f.png) 

  On this page +1. [The Problem: High Traffic, Constantly Changing Content](#the-problem-high-traffic-constantly-changing-content)
2. [Start with Your Highest-Traffic Pages](#start-with-your-highest-traffic-pages)
3. [Three Challenges They Had to Solve](#three-challenges-they-had-to-solve)
4. [1. Removing Unnecessary Livewire](#1-removing-unnecessary-livewire)
5. [2. Keeping Dynamic Pieces Dynamic](#2-keeping-dynamic-pieces-dynamic)
6. [3. Two Caching Layers Competing](#3-two-caching-layers-competing)
7. [Cache Busting When Content Changes](#cache-busting-when-content-changes)
8. [It Works on Any Stack](#it-works-on-any-stack)
9. [Key Takeaways](#key-takeaways)

 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)](https://x.com/gonedark) proved otherwise. Using the [Fast Laravel](https://fastlaravel.com) 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](https://alpine-ajax.js.org) 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](https://cloud.laravel.com), 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:

```php
// 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](https://laravelshift.com) 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](https://laravel-news.com/how-we-cached-laravel-news-at-the-edge-with-fast-laravel) — Laravel News, June 17, 2026.*

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [Cloudflare](https://www.msaied.com/public/articles?search=Cloudflare)
- [Edge Caching](https://www.msaied.com/public/articles?search=Edge%20Caching)
- [Performance](https://www.msaied.com/public/articles?search=Performance)
- [Alpine AJAX](https://www.msaied.com/public/articles?search=Alpine%20AJAX)
- [Cache Busting](https://www.msaied.com/public/articles?search=Cache%20Busting)

 Frequently asked questions 
---------------------------

  Can a high-traffic Laravel site with dynamic content be cached at the edge?Yes. The key is identifying which parts of the page are truly dynamic and isolating them. Static sections are served from the edge cache, while dynamic fragments — like rotating sponsors or a newsletter form — are loaded separately using a tool like Alpine AJAX after the cached page is delivered.

   How do you bust the Cloudflare cache when a scheduled Laravel article goes live?Because scheduled articles publish via a timestamp comparison rather than a model event, there is no automatic hook at publish time. The Laravel News team solved this by adding cache-clearing logic to an existing scheduled command (the one that posts to social media), accepting a worst-case staleness window of about five minutes.

   Does this edge caching approach require Laravel Cloud or a specific hosting provider?No. As long as Cloudflare sits in front of your application, the approach works on any server. JMac runs Laravel Shift on a $5/month DigitalOcean droplet, handling around 50,000 requests per day with ~20 ms edge response times.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleCursor Pagination, Lazy Collections, and Chunked Iteration at Scale in Laravel](https://www.msaied.com/public/articles/cursor-pagination-lazy-collections-and-chunked-iteration-at-scale-in-laravel) [Next articlePostgreSQL JSONB in Laravel: Indexing, Querying, and Casting Without the Chaos](https://www.msaied.com/public/articles/postgresql-jsonb-in-laravel-indexing-querying-and-casting-without-the-chaos-1)  

   On this page
-------------

1. [The Problem: High Traffic, Constantly Changing Content](#the-problem-high-traffic-constantly-changing-content)
2. [Start with Your Highest-Traffic Pages](#start-with-your-highest-traffic-pages)
3. [Three Challenges They Had to Solve](#three-challenges-they-had-to-solve)
4. [1. Removing Unnecessary Livewire](#1-removing-unnecessary-livewire)
5. [2. Keeping Dynamic Pieces Dynamic](#2-keeping-dynamic-pieces-dynamic)
6. [3. Two Caching Layers Competing](#3-two-caching-layers-competing)
7. [Cache Busting When Content Changes](#cache-busting-when-content-changes)
8. [It Works on Any Stack](#it-works-on-any-stack)
9. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
