abordage/laravel-last-modified
Laravel Last Modified adds automatic last-modified tracking to your Eloquent models, keeping timestamps in sync on create, update, and delete. Use it to power HTTP caching headers, sitemap dates, or "updated" badges with minimal setup and no extra tables.
Last-Modified headers (and evaluates conditional requests) from Eloquent model timestamps, letting clients get 304 Not Modified responses instead of full payloads. That translates into bandwidth savings and faster perceived loads — a lever a PM can pull without a redesign.Last-Modified semantics for API/HTML responses, and separates that concern from Cache-Control/CDN work.Adopt when all of the following hold:
updated_at (or an equivalent timestamp column) that genuinely changes when the represented content changes.If-Modified-Since — browsers, mobile clients, and most HTTP libraries do.Look elsewhere or defer when:
304 response — a correctness bug, not an optimisation.Cache-Control policy, or CDN/stale-while-revalidate behaviour; this package does not do that.Vary-aware caching middleware in place; running both invites conflicting validators and hard-to-reason-about behaviour.For executives (one line): A small, low-risk package that lets repeat visitors' browsers skip re-downloading pages that have not changed, reducing bandwidth and improving load times for the cost of a config change rather than a project.
For engineering:
Last-Modified + 304) driven by Eloquent timestamps, via middleware and per-route configuration.304 rate and bytes saved before broader rollout.updated_at; relationship or aggregated content needs an explicit freshness source; it composes poorly with a second ETag/caching layer, so pick one owner for conditional requests.How can I help you explore Laravel packages today?