incenteev/hashed-asset-bundle
incenteev/hashed-asset-bundle is a Symfony bundle for cache-busting static assets by generating and resolving hashed filenames. It helps serve versioned CSS, JavaScript, and images with long-lived browser caching while keeping templates clean and deployments predictable.
Flag first: this is not a Laravel package. It's a Symfony bundle (incenteev/hashed-asset-bundle) built for symfony/asset. If your stack is Laravel, this is out of scope — Laravel already gets content-hashed filenames from Vite/Mix manifests, and adopting this would mean introducing Symfony components for no reason. Treat this assessment as applying to Symfony-based services in the portfolio only.
For Symfony services, the decisions it informs are narrow but real:
assets_version string with a per-file content hash. The product consequence: you can serve assets with Cache-Control: max-age=31536000, immutable and only invalidate the files that actually changed on deploy, instead of purging the whole CDN/browser cache on every release. That's a measurable win in CDN egress and repeat-visit latency for asset-heavy pages.VersionStrategy implementation — roughly 20–50 lines against Symfony's own interface. The realistic options are (a) write it in-house, (b) use Symfony's built-in JsonManifestVersionStrategy if you already emit a manifest, (c) adopt this bundle. This is a "buy" only if you value zero implementation time over supply-chain risk.Adopt (or seriously evaluate) when all of these hold:
symfony/asset and Twig's asset().Look elsewhere (or skip) when:
JsonManifestVersionStrategy (or the framework's equivalent) already solves it with first-party support.If you do proceed: vendor the version-strategy class into your own codebase rather than taking a Composer dependency. MIT license permits it, the surface area is tiny, and it eliminates the abandonment risk entirely while keeping the behavior.
For executives (one paragraph): This is a small, free, MIT-licensed utility that makes browser and CDN caching more precise for our Symfony services — only assets that actually changed get re-downloaded, which improves repeat-visit performance and reduces CDN bandwidth. The catch is that it's a niche project with almost no adoption (26 GitHub stars, zero dependent packages), so I don't recommend taking it as a dependency. Instead, we can copy the ~50 lines of logic it implements into our own codebase under its permissive license and get the same benefit with zero maintenance risk. Treat this as a tactical optimization for older Symfony services, not a strategic platform choice, and it's superseded by Symfony's own AssetMapper for anything we modernize.
For engineering:
Symfony\Component\Asset\VersionStrategyInterface, returning a content-hash-derived version per asset. Small, readable surface — review the source before deciding.How can I help you explore Laravel packages today?