bolt/asset-cachebuster

📦 A Bolt 4/5 extension to bust cache for your assets

Installs: 78

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:bolt-extension

0.0.2 2021-05-10 10:03 UTC

This package is auto-updated.

Last update: 2024-11-10 17:42:35 UTC


README

Author: Ivo Valchev

A Bolt 4/5 extension to bust cache for your assets

What does it do?

Adds a version cachebuster to your Twig assets.

<link rel="stylesheet" href="{{ asset('styles.css') }}" />

Will output something like:

<link rel="stylesheet" href="/theme/your-theme/styles.css?v=0feef7" />

The version string is a hashed substring of your APP_SECRET. Therefore, whenever you need bust the cache, simply run:

php bin/console bolt:reset-secret

Installation

composer require bolt/asset-cachebuster

Running PHPStan and Easy Codings Standard

First, make sure dependencies are installed:

COMPOSER_MEMORY_LIMIT=-1 composer update

And then run ECS:

vendor/bin/ecs check src