PHPackages                             purplespider/silverstripe-assets-cachebusting - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. purplespider/silverstripe-assets-cachebusting

ActiveSilverstripe-vendormodule[Caching](/categories/caching)

purplespider/silverstripe-assets-cachebusting
=============================================

Automatic cache busting for SilverStripe assets by appending file hash to URLs

2.0.0(5mo ago)0301BSD-3-ClausePHP

Since Jan 30Pushed 5mo agoCompare

[ Source](https://github.com/purplespider/silverstripe-assets-cachebusting)[ Packagist](https://packagist.org/packages/purplespider/silverstripe-assets-cachebusting)[ RSS](/packages/purplespider-silverstripe-assets-cachebusting/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (8)Used By (1)

SilverStripe Assets Cache Busting
=================================

[](#silverstripe-assets-cache-busting)

Automatic cache busting for SilverStripe assets by appending file content hash to URLs.

Overview
--------

[](#overview)

This module adds automatic cache busting to all asset URLs in SilverStripe by appending a unique parameter based on the file's content hash. This allows you to set aggressive browser cache headers (long expiry times) while ensuring browsers and CDNs (like Cloudflare) fetch updated files when they change.

**Solves a common problem**: When a CMS user replaces an asset with a new file using the same filename, CDNs and browsers can serve the old cached version for hours or days. This module ensures the URL changes automatically when the file content changes, forcing immediate updates.

**Before:**

```
/assets/images/logo.png

```

**After:**

```
/assets/images/logo.png?m=a1b2c3d4e5

```

When the file content changes, the hash automatically updates, forcing browsers to fetch the new version.

Version Compatibility
---------------------

[](#version-compatibility)

Module VersionSilverStripe VersionAssets Version1.x5.x2.x2.x6.x3.x**For SilverStripe 5:** Use version 1.x

```
composer require purplespider/silverstripe-assets-cachebusting:^1.0
```

**For SilverStripe 6:** Use version 2.x (current)

```
composer require purplespider/silverstripe-assets-cachebusting:^2.0
```

Installation
------------

[](#installation)

Install via Composer (will install the version compatible with your SilverStripe installation):

```
composer require purplespider/silverstripe-assets-cachebusting
```

Then run dev/build:

**SilverStripe 5:**

```
vendor/silverstripe/framework/cli-script.php dev/build flush=1
```

**SilverStripe 6:**

```
vendor/bin/sake db:build --flush
```

Configuration
-------------

[](#configuration)

Cache busting is enabled by default. To disable it, add this to your config:

```
SilverStripe\Assets\File:
  enable_cache_busting: false
```

How It Works
------------

[](#how-it-works)

The module automatically appends a unique hash parameter to all asset URLs. The hash is based on the file's content, so it changes whenever a file is replaced - even if the filename stays the same.

This works everywhere: file links, images in WYSIWYG content, template references, resized images, and more. When a CMS user replaces an asset, Cloudflare and other CDNs immediately serve the new version.

Credits
-------

[](#credits)

Based on [SilverStripe Framework PR #2402](https://github.com/silverstripe/silverstripe-framework/pull/2402) by [@patbolo](https://github.com/patbolo).

License
-------

[](#license)

BSD-3-Clause. See [LICENSE](LICENSE) for details.

Contributing
------------

[](#contributing)

Contributions are welcome! Please open an issue or pull request on [GitHub](https://github.com/purplespider/silverstripe-assets-cachebusting).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance73

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

155d ago

Major Versions

1.0.5 → 2.0.02026-01-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/329880?v=4)[James Cocker](/maintainers/purplespider)[@purplespider](https://github.com/purplespider)

---

Top Contributors

[![purplespider](https://avatars.githubusercontent.com/u/329880?v=4)](https://github.com/purplespider "purplespider (11 commits)")

---

Tags

assetscachecache-bustingperformancesilverstripeperformancesilverstripecacheassetscache-busting

### Embed Badge

![Health badge](/badges/purplespider-silverstripe-assets-cachebusting/health.svg)

```
[![Health](https://phpackages.com/badges/purplespider-silverstripe-assets-cachebusting/health.svg)](https://phpackages.com/packages/purplespider-silverstripe-assets-cachebusting)
```

###  Alternatives

[silverstripe/staticpublishqueue

Static publishing queue to create static versions of pages for enhanced performance and security

44140.1k6](/packages/silverstripe-staticpublishqueue)[tractorcow/silverstripe-dynamiccache

FORK OF Silverstripe module for simple on the fly caching of dynamic content

3816.0k2](/packages/tractorcow-silverstripe-dynamiccache)[incenteev/hashed-asset-bundle

Apply an asset version based on a hash of the asset for symfony/asset

26538.9k1](/packages/incenteev-hashed-asset-bundle)[pstaender/silverstripe-redis-cache

Enables Redis cache for SilverStripe

11103.5k](/packages/pstaender-silverstripe-redis-cache)[silverstripe-terraformers/keys-for-cache

Silverstripe cache key management

1729.9k](/packages/silverstripe-terraformers-keys-for-cache)[spekkionu/assetcachebuster

Prefixes asset urls with a unique hash which will allow invalidation of asset files cached by the browser.

3243.4k](/packages/spekkionu-assetcachebuster)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
