JosephSilber

JosephSilber/page-cache

PHP MIT Web Dev Single maintainer risk

Caches responses as static files on disk for lightning fast page loads.

1.3k stars
119 forks
slow
GitHub

1.3k

Stars

119

Forks

31

Open issues

10

Contributors

v1.1.2 18 Mar 2026

AI Analysis

Laravel Page Cache caches HTTP responses as static files on disk to serve pages without booting the PHP application, enabling significant performance gains for mostly-static sites. It's specialized for Laravel developers who want to keep dynamic functionality while caching static page content, not suitable for real-time or frequently-changing applications. Ideal for content-heavy Laravel sites where selective full-page caching provides measurable speed benefits.

Web Dev Library Discovery value: 4/10
Documentation 8/10
Activity 6/10
Community 7/10
Code quality 5/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 7/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

page-caching laravel-middleware performance-optimization static-file-serving php
Actively maintained Well documented MIT licensed Niche/specialized use case Beginner friendly Production ready
Deep Analysis · Based on README and public signals
5d ago

Laravel page caching via static file generation—lightweight, stable, for mostly-static PHP sites

Page Cache is a Laravel middleware package that caches full HTTP responses as static HTML files on disk, allowing subsequent requests to be served directly by the web server without invoking PHP. Built for Laravel applications with substantial static or infrequently-changing content, it trades invalidation complexity for dramatic performance gains on cached routes. Adoption appears concentrated in the Laravel ecosystem; real-world production usage is not well-documented but the pattern is sound and long-proven.

Origin

Created July 2016, Page Cache emerged during Laravel's v5 era as a pragmatic alternative to full static site generators for dynamic PHP applications. It reflects a design philosophy: if most of your site is static, cache aggressively at the HTTP boundary rather than at the query or object level. The package has tracked Laravel releases for a decade, currently supporting Laravel 11+ and PHP 8.2+.

Growth

The package gained modest initial traction (1,256 stars over 10 years) and has remained relatively stable. Recent activity shows continued maintenance—last push March 2026—but zero star growth in the past week and lower star count than related caching packages. Growth appears flat, suggesting the package has found a defined audience but is not expanding beyond its original niche of static-heavy Laravel sites.

In production

Adoption not verified. No testimonials, case studies, or prominent production users mentioned in README. Download count not disclosed. Comparable packages (laravel-page-speed: 2,501 stars; phpfastcache: 2,408 stars) have higher visibility, suggesting Page Cache may serve a smaller or less publicly visible segment of the Laravel market. The pattern—full-page static file caching—is proven and widely used in production systems, but whether this specific package is used at scale remains undocumented.

Code analysis
Architecture

Based on README, the package operates as HTTP middleware: it intercepts 200-status GET responses, serializes them to disk in a `/public/page-cache` directory tree, and relies on web server rewrite rules (nginx `try_files`, Apache `RewriteCond`) to serve cached files directly before invoking PHP. Appears to support multiple content types (HTML, JSON, XML). Architecture is deliberately simple—no in-memory cache, no distributed coordination, no cache headers logic beyond HTTP 200 filtering.

Tests

Not documented in README. Build status badge present but no mention of test suite, coverage percentage, or testing approach in provided excerpt.

Maintenance

Last push March 2026 (4 months before analysis date) indicates active maintenance. Package version tracks Laravel releases (v2.0 for Laravel 11+, with v1.0.9 legacy branch for Laravel v5-v10), suggesting responsive updates to framework changes. However, no recent activity spike; maintenance appears reactive rather than proactive. No indication of breaking issues or urgent refactoring.

Honest verdict

ADOPT IF: your Laravel application is predominantly static or has long cache validity windows (news sites, docs, brochure pages); you control server configuration (nginx/Apache) and can implement URL rewriting; invalidation strategy is simple (e.g., cache-clear on deployment or on specific events); you want minimal operational overhead and don't need distributed cache. AVOID IF: your site has frequent dynamic content updates, require sub-request cache invalidation, run on managed hosting without rewrite control, or need fine-grained cache headers and TTLs. MONITOR IF: you're evaluating whether the simplicity-vs-flexibility tradeoff justifies adoption; test on a subset of routes first, as clearing requires manual deployment or cronjob-based invalidation.

Independent dimensions

Mainstream potential

3/10

Technical importance

6/10

Adoption evidence

2/10

Risks
  • Cache invalidation complexity: no automatic expiry or TTL; clearing requires explicit command or deployment script; risk of stale content if invalidation process fails or is forgotten.
  • Web server dependency: requires correct URL rewriting rules on nginx/Apache; misconfiguration silently breaks caching; not portable to serverless or restrictive managed hosting.
  • Limited observability: README does not document logging, monitoring, or debugging tools; difficult to diagnose why a page isn't cached or whether caching is working as expected.
  • Narrow adoption: lower star count and undocumented production usage raise uncertainty about real-world reliability at scale or in edge cases.
  • Static file attack surface: cached files stored in web root (`/public/page-cache`); potential security implications if files are indexed or exposed; `.gitignore` required but easy to overlook.
Prediction

Page Cache will likely remain stable and maintained within the Laravel ecosystem, but growth will remain modest. It solves a specific, well-defined problem for a niche (mostly-static Laravel sites) and does not compete with broader caching strategies (query caching, in-memory caches). Adoption may slowly increase as Laravel developers discover it, but mainstream dominance is unlikely; the package is more likely to remain a known-but-optional tool in the Laravel toolkit.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
100%

Information

Language
PHP
License
MIT
Last updated
4mo ago
Created
121mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

spatie

spatie/laravel-responsecache

A Laravel middleware package that caches entire HTTP responses (HTML, JSON) to...

2.8k PHP Web Dev
vinkius-labs

vinkius-labs/laravel-page-speed

Laravel Page Speed is a Laravel package that optimizes Blade-rendered pages and...

2.5k PHP Web Dev
mike-bronner

mike-bronner/laravel-model-caching

This package adds automatic, self-invalidating caching to Laravel Eloquent...

2.4k PHP Web Dev
TruCopilot

TruCopilot/phpfastcache

phpfastcache is a multi-backend caching abstraction layer for PHP that reduces...

2.4k PHP Web Dev
dwightwatson

dwightwatson/rememberable

Rememberable is a Laravel Eloquent trait that adds simple query result caching...

1.1k PHP Web Dev
vs. alternatives
laravel-page-speed

Higher star count (2,501 vs 1,256); scope appears broader (page speed optimization beyond caching). Direct comparison details unavailable from metadata.

phpfastcache

Higher stars (2,408); general-purpose PHP caching library (not Laravel-specific); covers memory, file, Redis, Memcached backends. Page Cache is narrower and more opinionated.

laravel-model-caching

Higher stars (2,369); operates at database query/model layer, not HTTP response layer. Different caching strategy; complementary rather than competitive.

rememberable

Lower stars (1,131); simpler query-result caching. Focuses on ORM-level caching rather than full-page response caching.

Jekyll / Jigsaw (static site builders)

Solve a related problem (static site generation) but require a build step. Page Cache trades off for zero build overhead on dynamic sites with mostly-static content.