PHPackages                             guidance/cachebuster - 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. guidance/cachebuster

ActiveMagento-module[Caching](/categories/caching)

guidance/cachebuster
====================

A Magento module which facilitates automatic purging of static assets from HTTP caches such as browser cache, CDN, Varnish, etc using best practices outlined within the HTML5 boilerplate community.

v1.0.1(10y ago)126887↓100%29[1 PRs](https://github.com/gknoppe-guidance/magento-cachebuster/pulls)Apache-2.0PHP

Since Feb 15Pushed 6y ago12 watchersCompare

[ Source](https://github.com/gknoppe-guidance/magento-cachebuster)[ Packagist](https://packagist.org/packages/guidance/cachebuster)[ RSS](/packages/guidance-cachebuster/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (11)Used By (0)

Magento Cachebuster
===================

[](#magento-cachebuster)

Cachebuster is a Magento module which facilitates automatic purging of static assets from HTTP caches such as browser cache, CDN, Varnish, etc using best practices outlined within the HTML5 boilerplate community.

See section "Filename-based cache busting" in:

URLs affected:

- /js/
- /media/
- /skin/

Overview
--------

[](#overview)

The module provides cachebusting by automatically altering the URI created by Magento for static files by adding the timestamp of the file to the filename:

- Before:
- After:

Example uses
------------

[](#example-uses)

- Automatically invalidating cache when using Cloudfront CDN (see  for a great how-to)
    - Amazon's Cloudfront CDN can be configured to use an origin server but by it's nature will not refresh your updated file until it's cache time expires or you send an invalidation request using their API.
- No more browser cache issues (ie. Them: "Where's that CSS change I requested?". You: "Oh, did you hit refresh?")
    - Magento's default .htaccess file uses far-future expires headers, which is good for reducing the number of requests to your server, but also means that even without a CDN you have probably experienced browser cache causing a waste of time on what turns out to be a non-issues.

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

[](#installation)

- Copy module files into your application
- Configure apache with the mod\_rewrite rules necessary for resolving the new filenames
- Enable the module in the Magento configuration

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

[](#configuration)

This module is configured via the "System" configuration section:

```
System -> Configuration -> Advanced -> System -> Cachebuster Settings

```

- **Enable cachebuster**
    - Enables the module behavior which rewrites URLs on the frontend. It is important that your mod\_rewrite rules are configured before enabling this setting.
- **File extensions**
    - Comma-separated list of file extensions which will be rewritten with timestamp applied. Extensions configured here must be defined in your rewrite rule.

**Note:** Behavior only takes affect on the frontend, admin area static file urls are not processed

mod\_rewrite configuration
--------------------------

[](#mod_rewrite-configuration)

The following mod\_rewrite rules need to be enabled for your store when using this module, potentially via `.htaccess` file or Virtualhost definition.

```

############################################
## rewrite files for magento cachebuster

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpeg|jpg|gif)$ $1.$3 [L]

```

If you are using the default media `.htaccess` file which routes missing URLs through Magento's `get.php` for downloadable products you will also need to add these rules to your `.htaccess` file in the `/media/` directory.

**Note:** This rewrite condition in the media directory will break the protection provided by downloadable products for the extensions listed. If your store sells downloadable products with one of the above extensions you will likely need to tweak these conditions.

nginx configuration
-------------------

[](#nginx-configuration)

For nginx you will need to add a rule like the following to your site definition.

```
location ~* (.+)\.(\d+)\.(js|css|png|jpg|jpeg|gif)$ {
    try_files $uri $1.$3;
}

```

License
-------

[](#license)

Licensed under the Apache License, Version 2.0

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~198 days

Recently: every ~236 days

Total

6

Last Release

3837d ago

Major Versions

v0.5 → v1.0.02015-11-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d8dcd58dec64a19cc7358d71232f6e703a1e60e88b0806d7dd508c3ecee9f98?d=identicon)[gknoppe-guidance](/maintainers/gknoppe-guidance)

---

Top Contributors

[![gordonknoppe](https://avatars.githubusercontent.com/u/475949?v=4)](https://github.com/gordonknoppe "gordonknoppe (8 commits)")[![rjocoleman](https://avatars.githubusercontent.com/u/154176?v=4)](https://github.com/rjocoleman "rjocoleman (3 commits)")[![avoelkl](https://avatars.githubusercontent.com/u/1798594?v=4)](https://github.com/avoelkl "avoelkl (1 commits)")

### Embed Badge

![Health badge](/badges/guidance-cachebuster/health.svg)

```
[![Health](https://phpackages.com/badges/guidance-cachebuster/health.svg)](https://phpackages.com/packages/guidance-cachebuster)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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