Edge Caching Laravel News with Cloudflare &amp; Fast Laravel | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    How Laravel News Cached a High-Traffic Site at the Edge with Fast Laravel and Cloudflare        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)

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

 [  Laravel ](https://msaied.com/articles?category=laravel) [  Tips &amp; Tricks ](https://msaied.com/articles?category=tips-tricks)  #Laravel   #Cloudflare   #Edge Caching   #Performance   #Alpine AJAX   #Cache Busting  

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

     17 Jun 2026      4 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

  9 sections  

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

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fhow-laravel-news-cached-a-high-traffic-site-at-the-edge-with-fast-laravel-and-cloudflare&text=How+Laravel+News+Cached+a+High-Traffic+Site+at+the+Edge+with+Fast+Laravel+and+Cloudflare) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fhow-laravel-news-cached-a-high-traffic-site-at-the-edge-with-fast-laravel-and-cloudflare) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  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. 

      Q02  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. 

      Q03  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. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![PostgreSQL CTEs, Recursive Queries, and Lateral Joins in Laravel](https://cdn.msaied.com/241/32858f9c67eae0649999c32a6d31818f.png) laravel postgresql query-builder 

### PostgreSQL CTEs, Recursive Queries, and Lateral Joins in Laravel

Go beyond basic Eloquent with raw PostgreSQL power: composable CTEs, recursive tree traversal, and LATERAL joi...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 19 Jun 2026     3 min read  

  Read    

 ](https://msaied.com/articles/postgresql-ctes-recursive-queries-and-lateral-joins-in-laravel) [ ![PostgreSQL Window Functions in Laravel: Ranking, Running Totals, and Gap Detection](https://cdn.msaied.com/239/f588e7cbf8e6d3317a581ce0fa27140d.png) laravel postgresql eloquent 

### PostgreSQL Window Functions in Laravel: Ranking, Running Totals, and Gap Detection

Window functions let you compute rankings, running totals, and gaps directly in SQL without pulling rows into...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 19 Jun 2026     3 min read  

  Read    

 ](https://msaied.com/articles/postgresql-window-functions-in-laravel-ranking-running-totals-and-gap-detection) [ ![Custom Eloquent Casts: Encapsulating Domain Logic Inside Model Attributes](https://cdn.msaied.com/238/8e843e57a34f81f853eedefae629c09b.png) laravel eloquent domain-driven-design 

### Custom Eloquent Casts: Encapsulating Domain Logic Inside Model Attributes

Custom Eloquent casts let you push value-object logic directly into model attributes, keeping controllers and...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 19 Jun 2026     3 min read  

  Read    

 ](https://msaied.com/articles/custom-eloquent-casts-encapsulating-domain-logic-inside-model-attributes) 

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

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
