Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Cloudflare Cache Laravel Package

yediyuz/laravel-cloudflare-cache

Integrate Cloudflare edge caching into Laravel: cache responses, automatically purge URLs or tags on model changes, and manage cache behavior from familiar Laravel APIs. Reduce origin load and speed up responses with minimal configuration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for edge caching. Replaces a bespoke Cloudflare API integration (auth, zone resolution, purge batching, tag management) with an MIT-licensed package. The real decision this informs is "do we spend 2–6 engineer-weeks writing and maintaining a cache-purge client, or do we adopt and wrap one?"
  • Roadmap sequencing for a performance initiative. Gives a concrete, low-cost lever (edge caching) that can ship ahead of heavier work like database sharding, read replicas, or a CDN migration. Useful for deciding whether the next perf milestone is "cache more" or "scale origin."
  • Infrastructure cost decisions. Shifting repeatable GET traffic to the edge is a direct origin-cost lever. This package makes that experiment cheap enough to run as a time-boxed spike with a measurable cost delta rather than a quarter-long project.
  • Caching strategy standardization. If the org already runs Cloudflare across multiple Laravel services, this becomes the reference implementation for tag-based invalidation, giving product a consistent "content goes stale within N seconds" guarantee across surfaces.
  • Feature-level use cases it unblocks: marketing/CMS pages, public catalog and listing pages, blog and docs, public unauthenticated GET APIs, product detail pages where slight staleness is acceptable and invalidation is event-driven.
  • Explicit non-use cases it should not be cited to justify: per-user dashboards, authenticated feeds, anything with personalized or permission-scoped content, and cart/checkout flows. Documenting these boundaries is itself a product decision that prevents a class of incidents.

When to Consider This Package

Adopt when most of these are true:

  • You are already standardized on Cloudflare as your CDN/proxy — the package is worthless otherwise, and this is the single hardest gate.
  • The application is Laravel and read-heavy: traffic is dominated by cacheable GET responses, and origin load is a real cost or latency problem today.
  • You need programmatic invalidation tied to domain events (model updated, article published, price changed) rather than manual purges.
  • You want tag-based purge semantics without hand-rolling the API surface, and your team has no dedicated platform engineer to own a custom integration.
  • You can tolerate eventual consistency in the seconds-to-minutes range and can design UX around it.
  • You are comfortable vendor-coupling this layer to Cloudflare, and your exit path is "swap the middleware," not "re-architect."

Look elsewhere when any of these are true:

  • You are on Fastly, Akamai, CloudFront, or an uncommitted CDN strategy — a multi-CDN or CDN-agnostic abstraction is the better investment, and this package will become technical debt the moment you leave Cloudflare.
  • You need per-user or per-permission cache variation at the edge. Edge caching is the wrong tool; solve it at the origin or with a personalization layer.
  • Your traffic is modest. Below meaningful origin load, cache invalidation adds a correctness surface (stale pricing, stale inventory, stale permissions) that outweighs the savings.
  • You require strong purge guarantees, sub-second invalidation SLAs, or strict auditability of what was served when — the edge is a poor fit for compliance-bound content.
  • You want first-party support and a large maintainer community. At roughly 280 stars with a single-primary-maintainer profile, this is a dependency you may end up owning. Budget for vendoring or forking, and confirm the maintainer's responsiveness before it lands in a critical path.
  • The team already has an internal cache-invalidation service or a platform team that would rather expose a shared caching primitive than have each service adopt its own package.

How to Pitch It (Stakeholders)

To executives — one paragraph: We can cut origin load and improve page latency for our public, cacheable pages by pushing responses to Cloudflare's edge and invalidating them programmatically when content changes. This package is a thin, MIT-licensed Laravel wrapper that removes most of the custom integration work, so the experiment costs days rather than a quarter. It is a cost-avoidance and latency play, not a new platform: the primary risk is that it deepens our dependence on Cloudflare, and the secondary risk is maintainer concentration in a small open-source project. Both are manageable with a documented exit path — the integration point is a middleware layer, and we can fall back to Cloudflare's raw API at any time. Recommendation: time-boxed pilot on one high-traffic public surface, with success measured on cache hit ratio, p95 time-to-first-byte, and monthly origin spend.

To engineering — the honest version: Treat this as a convenience wrapper, not a platform. The value is in the invalidation ergonomics (tags, event-driven purges, middleware) and in not maintaining a homegrown API client; the cost is a correctness surface you now own. Before adoption, we need: a cache-key design review (what varies, what must never be cached), an explicit allowlist of cacheable routes rather than a blanket middleware, purge-on-deploy wired into CI, and observability on hit ratio and purge failures. Write integration tests against a real zone in a staging account, and confirm the maintainer's release cadence and issue response time — at this star count, assume we may need to fork.

To both — the decision we are actually asking for: approval to run a four-week pilot on one public surface with a pre-agreed kill criterion (no measurable origin reduction, or any stale-content incident attributable to the layer). If the pilot fails, we lose the spike cost and keep the knowledge; if it succeeds, we have a repeatable pattern at near-zero licensing cost.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle