Speeding Up Laravel News With Cloudflare
Performance tuning in Laravel often begins with database indexes, query optimization, or infrastructure upgrades. However, significant gains can often be achieved through a simpler realization: many portions of your Laravel application are effectively static. In a recent discussion, I had the opportunity to sit down with JMac, the creator of Laravel Shift and the new Fast Laravel course, to explore how Cloudflare page caching can dramatically transform a production Laravel application. We used Laravel News itself as a case study, and here are some of the key highlights from our conversation.
Why Laravel Apps Often Miss Out on Caching
Out of the box, Laravel is not optimized for caching at the page level. Factors such as sessions, middleware defaults, and dynamic rendering signal to Content Delivery Networks (CDNs) that responses should be treated as personalized. As a result, many Laravel applications sit behind Cloudflare but fail to benefit from page caching. In the case of Laravel News, Cloudflare was enabled primarily for DDoS protection. While assets like images, CSS, and JavaScript were cached automatically, HTML responses consistently bypassed the cache. This led to a situation where the site appeared static to users but behaved as a fully dynamic application with every request.
The Homepage Problem (And Opportunity)
For most websites, the homepage is the most visited page by a significant margin, and Laravel News is no exception. Despite being built with Livewire, the homepage lacks interactivity, polling, and user-specific content. It only changes when a new article is published, making it an ideal candidate for page caching. Jason explains that even relatively short cache windows can yield substantial benefits. If a homepage can be cached for just 30 to 60 minutes, the reduction in compute load and improvement in response times are immediate and measurable.
Livewire, Blade, and Static Rendering
One of the most interesting aspects of our discussion centered on Livewire. While Livewire is an excellent tool for creating interactive interfaces, its use for non-reactive pages can unintentionally block caching opportunities. In this case, the homepage utilized Livewire components primarily as data loaders with cached computed properties. Although this approach works, it still forces Laravel and PHP to execute on every request. The proposed refactor is intentionally minimal: replacing non-reactive Livewire components with Blade components or simple cached queries. This change maintains the same behavior while making the page fully cacheable at the CDN level.
Cloudflare’s Free Tier Is Often Enough
A key takeaway from our conversation is how much Cloudflare offers on its free plan. Page caching rules, cache control headers, Web Application Firewall (WAF) rules, redirects, and even services like Turnstile are available without requiring an upgrade. The Fast Laravel course focuses on applying these tools strategically rather than completely re-architecting applications. The goal is not to fight Laravel’s conventions but to work with them more intentionally.
Performance Gains and Cost Savings
Beyond faster response times, effective caching directly impacts infrastructure costs. When fewer requests reach PHP and your application servers, CPU usage drops, memory pressure decreases, and scaling becomes less reactive. As Laravel News prepares to migrate to Laravel Cloud, there is an opportunity to measure how CDN-level caching affects real-world compute usage and monthly costs.
A Practical Path to Faster Laravel Apps
The primary takeaway from this discussion is straightforward: you do not need to rewrite your application or abandon Laravel’s ecosystem to achieve meaningful performance gains. By identifying truly static pages, understanding how framework defaults affect caching, and configuring Cloudflare correctly, many Laravel applications can see immediate improvements in both speed and cost. This upcoming Laravel News case study will put these ideas into practice, and the results should be beneficial for anyone running Laravel in production today.
Check out JMac’s products:
Frequently Asked Questions
The main benefit of using Cloudflare for Laravel applications is the ability to implement page caching, which can significantly improve response times and reduce server load. This is particularly beneficial for static pages, such as homepages, which do not change frequently.
Livewire components can affect caching in Laravel by forcing the server to execute on every request, even for non-reactive pages. This can block caching opportunities. Replacing non-reactive Livewire components with Blade components or cached queries can make pages fully cacheable at the CDN level.
Yes, the free tier of Cloudflare is often sufficient for most Laravel applications. It provides essential features such as page caching rules, cache control headers, and WAF rules, allowing developers to enhance performance without incurring additional costs.
Call To Action
If you’re looking to enhance the performance of your Laravel applications, consider implementing Cloudflare’s caching features. Start optimizing today to improve response times and reduce costs effectively.
Note: By leveraging Cloudflare’s capabilities, you can significantly improve the performance of your Laravel applications without extensive rewrites or complex configurations.

