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

Assetcachebuster Laravel Package

spekkionu/assetcachebuster

A Laravel package that adds cache-busting version strings to asset URLs, helping browsers load updated CSS and JavaScript after deployments. It integrates with Laravel's asset helper and supports configurable versioning for reliable cache invalidation.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Cache-invalidation strategy for a release. If users report stale CSS/JS after a deploy, this package is a candidate answer: prefix asset URLs with a content/build hash so browsers fetch fresh files without changing cache headers or filenames on disk. v2.0.0 extends the mechanism to Laravel 5, widening the set of surfaces where that fix is available without a build pipeline.
  • Build vs. buy vs. borrow for asset versioning. Helps frame the decision as three options — pull in a tiny MIT package, use the framework's native mechanism (Laravel Mix from 5.4, later Vite), or write a 20-line helper. The v2.0.0 release sharpens the boundary: it covers Laravel 4.x through 5.3, i.e. the window before mix() existed. On 5.4+ the "borrow the pattern, use the native API" answer still wins.
  • Deployment topology and CDN strategy. Hash-prefixed URLs pair well with long max-age/immutable caching and CDN edge caching; the decision to set aggressive cache headers is only safe once you have a versioning mechanism. This package makes that trade-off explicit and cheap to test.
  • Rollback safety. Unique-per-release prefixes mean reverting an application deploy does not strand users on missing assets — old hashed URLs remain resolvable if you keep prior builds. This is a reliability/on-call decision, not just a frontend nicety.
  • Upgrade sequencing for legacy estates. v2.0.0 being a major bump (v1 → v2 for Laravel 5 support) means adopting teams inherit a version axis: pin v2 for 5.x, stay on v1 only if stuck on 4.x. That is a concrete line item for any "upgrade Laravel 4 to 5" roadmap and a reminder that the package's API surface is not a stable contract.
  • Roadmap triage for legacy surfaces. For an inherited Laravel 4.x or 5.0–5.3 app with no asset build step, this is a stopgap to close a user-visible defect without funding a full Vite/webpack migration. It informs sequencing: patch now, migrate next quarter.
  • Sprint prioritization. It quantifies the cost side of the "should we fix asset caching this sprint?" question — hours of integration versus days for a build-pipeline change — which is useful when the visible symptom (stale UI) is low-severity but recurring.

When to Consider This Package

Consider it when:

  • You are on a legacy Laravel 4.x or 5.0–5.3 application with no asset compilation step and no appetite for introducing one. (v2.0.0 materially expands this band from "4.x / early 5.x" to the full pre-Mix 5.x range.)
  • Assets are served directly from public/ with long-lived cache headers and you need per-deploy invalidation with minimal configuration.
  • The app is internal or low-traffic, where the blast radius of a stale-asset bug is small and a one-maintainer package is an acceptable trade.
  • You need a cheap stopgap while an asset-pipeline migration is scoped, and you are willing to pin the version and vendor the code.
  • You want a readable reference pattern for how hash-prefixing works before building it in-house.

Look elsewhere when:

  • You are on Laravel 5.4+ (mix()) or Laravel 9+ (Vite) — native content-hashed URLs already solve this with first-party support, zero extra dependency, and SRI/manifest support. Note that v2.0.0 does not change this: it targets 5.x, not 5.4+'s Mix workflow, so it is not a substitute for mix().
  • You already run webpack, Vite, Rollup, or any bundler that emits hashed filenames; adding a URL-prefix layer duplicates the mechanism and creates two sources of truth.
  • You need subresource integrity, per-file granularity, CDN purge hooks, or atomic multi-file releases — this class of tool works at whole-URL granularity, not per-asset.
  • You are on modern PHP (8.x) or a framework version released after 2015; a compatibility bump for Laravel 5 is not evidence of ongoing maintenance — it is a 2015-era release, and a compatibility bump should not be read as a revival.
  • Your dependency policy requires maintained upstreams (SOC 2, vendor review, or an SLO-backed production surface). Zero dependents and no release since the mid-2010s means you are the maintainer the moment you install it.
  • You are mid-migration and cannot absorb a major version bump. v2.0.0 is not a patch; budget a review of the v1 → v2 diff and a re-test before letting an automated update land.

How to Pitch It (Stakeholders)

To executives (one paragraph): We occasionally ship a release and a slice of users keep seeing the old stylesheet or script until they hard-refresh. It is not an outage, but it generates support tickets and erodes trust in releases. The fix is a well-understood technique — give each asset URL a release-specific prefix so browsers treat it as a new file. A small MIT-licensed package does this in an afternoon, and its latest release extends support to Laravel 5, which covers our older apps without a modern build step. Two caveats: the package itself is from 2015 with a single maintainer and no recent releases, and the new version is a major bump rather than a routine patch. So my recommendation stands — adopt the pattern via the framework's built-in asset versioning where we are on Laravel 5.4+, and reserve this package for the pre-Mix legacy app where no build step exists. Cost either way is measured in hours, not weeks; the decision is low-risk and easy to reverse. The release does not change that calculus; it slightly widens where the stopgap is technically viable.

To engineering: The mechanism is simple and side-effect-free — rewrite emitted asset URLs with a build/deploy hash, leave files and cache headers untouched. Integration is a Blade/helper-level change, no runtime dependency beyond the hash source. What v2.0.0 changes is the compatibility floor only: Laravel 5 is now supported, so the package is in-scope for 5.0–5.3 projects that previously had no supported option. It does not make it a replacement for mix() on 5.4+, and a major version bump means an explicit v1 → v2 review rather than a composer update. Three caveats to weigh: (1) it remains unmaintained since the mid-2010s, so pin the version (v2 for 5.x, v1 for 4.x), vendor or fork it, and add a smoke test asserting the hash changes between builds; (2) if we are on Mix or Vite, use mix()/@vite instead and treat this repo as documentation; (3) if we adopt it, pair it with immutable cache headers and a retained-artifacts policy so rollbacks keep old hashed URLs resolvable — otherwise we have added a dependency without capturing the reliability win.

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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin