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
Rest E Tag Bundle

Rest E Tag Bundle Laravel Package

kleijnweb/rest-e-tag-bundle

Symfony bundle that adds ETag and conditional-request support to REST APIs. It generates entity tags, honors If-None-Match and If-Match headers, and returns 304 Not Modified responses to improve caching and reduce bandwidth for JSON endpoints.

View on GitHub
Deep Wiki
Context7

Caching and Concurrency Control for REST APIs using E-Tag Headers

Frequently asked questions about Rest E Tag Bundle
Can I use kleijnweb/rest-e-tag-bundle in a Laravel application?
No, not directly. It is a Symfony bundle that targets Symfony's HttpKernel, dependency injection container, compiler passes, and event dispatcher, none of which Laravel exposes in a compatible form. A Composer install would add classes that never boot under Laravel. The practical approach is to read its ETag resolution logic and implement equivalent Laravel middleware.
How do I install and enable kleijnweb/rest-e-tag-bundle?
In a Symfony application you would install it with Composer and register the bundle in your kernel according to Symfony's bundle conventions. The provided context does not include exact installation or configuration steps. For Laravel there is no supported installation path because the bundle has no service provider or Laravel middleware. Confirm composer.json constraints and Symfony version support before attempting adoption.
Which PHP and Symfony versions does this bundle support?
The release notes excerpt does not state a compatibility matrix. You must inspect composer.json for PHP and Symfony version constraints, especially whether Symfony 5, 6, or 7 and PHP 7.x or 8.x are supported. A v1.0.0 release pinned to an older Symfony line would be a dead end for current projects. Treat this as a blocking check before any pilot.
Does kleijnweb/rest-e-tag-bundle automatically return 304 Not Modified?
Yes, the bundle is described as integrating with Symfony's request/response lifecycle to generate entity tags and return 304 Not Modified when a cached representation is still valid. It honors If-None-Match for conditional GET requests. That behavior is Symfony-specific; in Laravel you would implement the same flow with middleware and Symfony HttpFoundation response methods.
What is the advantage of this bundle over custom Laravel ETag middleware?
The bundle's delta is annotation or attribute-driven metadata resolution and Symfony listener wiring. None of that is portable to Laravel. A custom Laravel middleware can use the symfony/http-foundation primitives Laravel already depends on, giving you ETag generation, If-None-Match checks, and 304 responses without a framework-mismatched dependency. For Laravel, in-house middleware is lower risk and easier to test.
Is kleijnweb/rest-e-tag-bundle actively maintained and safe for production?
It is single-maintainer open source and v1.0.0 is the first stable release, so there is no long track record of backward-compatibility discipline. Check commit cadence, open-issue age, CI coverage, and license before production use. Release integrity is also a concern: the notes mention an MD5 checksum, which is collision-broken and not a supply-chain control. Ask for SHA-256 or signed releases and a security disclosure process.
How does the bundle handle If-Match and 412 Precondition Failed?
The overview says the bundle honors If-Match as well as If-None-Match, which is the correct foundation for optimistic concurrency on write endpoints. A failed If-Match should produce 412 Precondition Failed rather than silently overwriting data. The provided context does not document the exact implementation, so verify it in code and tests before relying on it for writes.
Does the bundle support weak and strong ETags, Vary headers, and HEAD requests?
The provided context does not document weak versus strong ETag handling, Vary header behavior, or HEAD request support. These are important for correct HTTP caching and proxy/CDN behavior. Treat them as evaluation criteria and inspect the source and test suite. If you reimplement in Laravel middleware, handle them explicitly.
What are the alternatives to this bundle for Laravel API caching?
For Laravel, the most direct alternative is custom middleware using Symfony HttpFoundation's Response ETag and isNotModified helpers, which Laravel already ships with. You can also rely on a reverse proxy or CDN that manages ETags and conditional requests. For Symfony services, the bundle itself or a custom kernel listener are the natural options. The key decision is framework fit, not feature count.
How should I test ETag behavior before adopting this package?
First confirm composer.json compatibility with your PHP and Symfony versions. Then spike one read-heavy endpoint with If-None-Match returning 304 and one write endpoint with If-Match returning 412. Add checks for Vary and HEAD handling, and verify behavior through a proxy or CDN if you use one. For Laravel, write feature tests around equivalent middleware instead of installing the Symfony bundle.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo