Download the PHP package purplespider/silverstripe-assets-cachebusting without Composer

On this page you can find all versions of the php package purplespider/silverstripe-assets-cachebusting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-assets-cachebusting

SilverStripe Assets Cache Busting

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

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:

After:

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

Version Compatibility

Module Version SilverStripe Version Assets Version
1.x 5.x 2.x
2.x 6.x 3.x

For SilverStripe 5: Use version 1.x

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

Installation

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

Then run dev/build:

SilverStripe 5:

SilverStripe 6:

Configuration

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

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

Based on SilverStripe Framework PR #2402 by @patbolo.

License

BSD-3-Clause. See LICENSE for details.

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.


All versions of silverstripe-assets-cachebusting with dependencies

PHP Build Version
Package Version
Requires silverstripe/assets Version ^3.0
silverstripe/framework Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package purplespider/silverstripe-assets-cachebusting contains the following files

Loading the files please wait ...