How We Cached Laravel News at the Edge with Fast Laravel

Published on by

I sat down with JMac for the Laravel Creator Series to talk about something we just finished on our end: caching Laravel News at the edge using his Fast Laravel course and Cloudflare. We treated the site as a case study, and now that it's deployed, we wanted to share what we did and where we got stuck.

The interesting part is that Laravel News is a high-traffic site whose content is changing constantly. New articles, new links, new sponsors, the toast notification at the top. A lot of people assume a page like that can't be cached. The whole point of this conversation is that it can.

Start with Your Top Pages

Jason took a systematic approach. You look at your request traffic, find your highest-hit pages, and cache those first, then work your way down the list until the top requests are just low-traffic sub pages. For us that came down to about five pages:

Three Things We Had to Work Through

The site is mostly static but dynamic in a few specific places, so there were three main challenges.

Dropping Livewire where we didn't need it. The site was built so that nearly everything was a Livewire component, but only the newsletter form actually used Livewire's reactive nature. Everything else was really just Blade templates. Converting those back to plain Blade components was a super straightforward refactor, and it isolated the few areas that genuinely need to stay dynamic.

Keeping the dynamic bits dynamic. A few pieces can't be frozen into a cached page: the toast notification, the newsletter, and the sponsor and partner slots that rotate per request so the same partner isn't shown all day. We were already using Alpine for Livewire, so we added Alpine AJAX and used it to swap those components out on page load.

Two caching layers competing. Laravel News runs on Laravel Cloud, which offers edge caching built into the platform and uses Cloudflare underneath. Since we were already on Cloudflare directly, the two layers competed, and it was hard to tell whose policies were in effect or to bust the Cloud layer cleanly. The Laravel Cloud team was super supportive while we diagnosed it, but in the end it was simpler to bypass the Cloud rules and use our Cloudflare directly. You get all the same benefits underneath.

Busting the Cache When Content Changes

We bust cache on deploy like any other site, but the real work is clearing it when an article is published or links get approved. Most of that runs through Laravel model events. When an article updates, we listen for the updated event and clear that specific article, plus the home page and blog page since a recent post shows up there too.

The tricky one was scheduled articles. We write articles the night before and schedule them to publish at 9am, so there's no event firing in the moment the post goes live, just a query comparing against published_at. The simplest fix was to piggyback on a command we already run to share new posts to social media. That command now also clears the home page, blog, article, and links pages. Worst case, a page is stale for about five minutes while it runs.

It Works Anywhere

Jason was clear that none of this is specific to Laravel Cloud. As long as you have Cloudflare in front of your app, it works on any server. He runs Laravel Shift on a $5 a month DigitalOcean box that handles around 50,000 requests a day with the entire public-facing side cached, and he sees response times around 20 milliseconds from the edge.

The one current exception is Livewire, since it relies heavily on the session for its reactivity. Jason is talking with Caleb Porzio about an anonymous component that could come to life after a page loads. Inertia, React, and anything else doing API calls are all fine.

For us the results were immediate. Laravel News went from caching in the teens to a majority of requests cached, with spikes up toward 70%, and the site just feels faster. The next step is going back in a quarter or so to see if all that reduced server traffic lets us drop down to a lower compute tier without anyone noticing.

Check It Out

Give the video a watch for the full conversation, and go check out Fast Laravel. As Jason put it, edge caching is one of those forgotten practices worth taking another look at, and once you learn it you can carry it forward to every site you build.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises

The latest

View all →
The artisan dev Command in Laravel 13.16.0 image

The artisan dev Command in Laravel 13.16.0

Read article
LaraOwl: Self-Hosted Monitoring for Laravel Applications image

LaraOwl: Self-Hosted Monitoring for Laravel Applications

Read article
Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard image

Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard

Read article
Subscriptionify: Feature-Based Subscription Management for Laravel image

Subscriptionify: Feature-Based Subscription Management for Laravel

Read article
Toolkit: Reusable AI Tools for the Laravel AI SDK image

Toolkit: Reusable AI Tools for the Laravel AI SDK

Read article
Laracon US 2026 Reveals Its Full Speaker Lineup image

Laracon US 2026 Reveals Its Full Speaker Lineup

Read article