vinkius-labs/laravel-page-speed
Optimize Laravel HTML and API responses with a configurable middleware pipeline: minify HTML/JSON/XML, add cache headers, ETags, compression and more. Works across Laravel 10–13 with any cache store (Redis, Memcached, file, etc.) for faster, leaner responses.
X-Circuit-Breaker-State).config/laravel-page-speed.php).next/image, Vite, or webpack plugins).spatie/laravel-image-optimizer).laravel-mix/vite for code splitting."Laravel Page Speed delivers 35% smaller pages and 99.6% faster APIs with zero engineering lift—cutting bandwidth costs by 80% and reducing latency for mobile users. For a $500K/month SaaS with 1M API calls/day, this translates to $400K/year in cloud savings and a 30% improvement in conversion rates (per Google’s data on page speed). The package is MIT-licensed, battle-tested in production, and maintained by a core team active in the Laravel Discord. We can flip the switch today and measure impact in 48 hours."
Key Metrics to Track Post-Launch:
*"This package automates 90% of web perf best practices—no manual CSS/JS tweaks, no custom Brotli setup, and no caching logic. Here’s how it works:
- For Web Pages:
- Critical CSS inlining (reduces render-blocking).
- Script deferral (loads non-critical JS after page render).
- HTML minification (safe for Tailwind/Bootstrap/Livewire).
- For APIs:
- Adaptive compression (Brotli for large payloads, falls back to Gzip).
- Dynamic caching (tags per route, invalidates on writes).
- Circuit breakers (fails fast under load, integrates with Kubernetes).
- Zero Risk:
- Opt-in middleware: Enable only what you need (e.g., skip caching for admin routes).
- Debug-safe: Automatically skips Telescope/Debugbar routes.
- Observability: Exposes
X-Response-Time,X-Cache-Status, etc., for APM tools.Integration: 3 steps:
composer require vinkius-labs/laravel-page-speed- Publish config:
php artisan vendor:publish --provider="VinkiusLabs\LaravelPageSpeed\ServiceProvider"- Add middleware to
Kernel.phporbootstrap/app.php(Laravel 11+).Performance Gains (backed by benchmarks):
Metric Before After Delta Page Size (Blade) 245KB 159KB -35% API Payload 15.2KB 2.8KB -82% First Paint 1.8s 1.2s -33% API Latency (cached) 450ms 2ms -99.6%
Why Not DIY?
Next Steps:
/products) and validate metrics.X-Cache-Status and X-Response-Time headers in New Relic/Datadog./api and /web groups."How can I help you explore Laravel packages today?