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 Http Remember

Laravel Http Remember Laravel Package

philipannis/laravel-http-remember

A small Laravel package that brings Cache::remember-style caching to the HTTP client. Cache outgoing API responses per request with a configurable TTL and cache store, then serve repeated calls from cache to reduce latency, duplicate requests, and load on rate-limited third-party APIs.

View on GitHub
Deep Wiki
Context7

Laravel HTTP Remember adds a fluent remember() method to Laravel's HTTP client, letting you cache outbound API responses without hand-rolling Cache::remember wrappers around every request. It preserves the expressive syntax you already use while sparing slow, expensive, or rate-limited third-party endpoints from repeated calls.

  • Drop-in macro — no changes to your existing Http:: calls
  • Flexible TTL — cache responses for seconds, minutes, or indefinitely
  • Custom keys & stores — override the generated key or choose a cache store per request
  • Simple invalidation — forget or flush cached responses by key
  • Test-friendly — works alongside Http::fake() and Laravel's cache fakes
Frequently asked questions about Laravel Http Remember
How do I install and configure philipannis/laravel-http-remember in a Laravel app?
Install the package with Composer, then register the middleware on the route groups where you want outgoing HTTP responses cached. You will also need to configure a cache store and define your cache key, TTL, and ignored header policies. Expect low-to-moderate effort, and validate the exact registration steps against the package documentation for your Laravel version.
Which Laravel and PHP versions does laravel-http-remember support?
The available material does not pin an explicit Laravel or PHP support matrix, so check the repository README and composer.json constraints before adopting it. Confirm compatibility with your exact Laravel and PHP versions during a proof of concept. Version support is one of the open questions flagged in the technical assessment.
How does the remember() method cache HTTP client responses with a TTL?
The package adds a remember-style helper to Laravel's HTTP client so a successful response is stored in your application's cache store and reused on later requests until the TTL expires. It handles cache key construction and response storage for you, so you do not need to wrap Http calls in Cache::remember manually. Only successful responses are intended for caching, and behavior for error responses should be verified in the docs.
How are cache keys constructed, and what do ignored cache key headers do?
Cache keys are generated by the package from the request, and you can define a policy for which headers are ignored so that key stability is not broken by volatile values such as CDN or proxy headers. Ignored headers prevent unnecessary cache fragmentation, but they also mean two requests differing only in those headers will share a cached response. Review this carefully for any user-specific or auth-related headers.
Does laravel-http-remember cache only safe methods such as GET and HEAD?
The assessment lists method safety as a key question to verify, so confirm in the documentation whether only GET and HEAD are cached. As a rule, enable the middleware only on idempotent, read-only endpoints. Avoid caching POST or other state-changing requests unless you have explicitly validated the behavior.
Which cache drivers support group invalidation reliably?
Group invalidation behavior varies by cache driver, and the assessment recommends a shared store such as Redis when you need consistent purge semantics across multiple nodes. Test purge scenarios for your specific driver before relying on group invalidation in production. The exact driver support matrix should be validated against the package documentation.
What are the defaults for conditional caching and response size limits?
Version 1.0.2 adds conditional caching and response size limits, but the available context does not state their default values. Read the documentation and test both settings explicitly before rollout. Size limits matter for large payloads, and conditional caching determines which requests are eligible to be served from cache.
Can cached API responses leak authenticated or personalized data?
Yes, that is the main risk to design against. If you cache responses that depend on auth, session, cookies, Vary, or user-specific headers, one user's data can be served to another. Scope the middleware to public, non-personalized route groups, build keys carefully, and verify how Cache-Control: no-store and Vary are handled.
Where do laravel-http-remember event logs go, and do they contain PII?
The release adds event logs for observability, but their destination and payload contents are not specified in the available context. Wire them into your existing monitoring and confirm whether any request or response data is recorded. Redact or disable logging of sensitive fields if PII could be captured.
Is laravel-http-remember ready for production, and should I pin the Composer version?
It is early-stage and likely single-maintainer, and v1.0.2 added feature-level capabilities in a patch release, so treat it as a focused utility rather than a battle-tested platform component. Pin the Composer version, review changelogs, and regression-test each upgrade. Run a proof of concept on a low-risk route, load-test hit rates, invalidation, staleness, and cache-key correctness, then roll out by route group with rollback criteria.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager