opsdev/cache-breaker

Create link to static resources with cache-breaking segment based on md5 of the file

Installs: 7 453

Dependents: 0

Suggesters: 0

Stars: 4

Watchers: 4

Forks: 1

Open Issues: 1

Type:typo3-flow-package

4.0.0 2018-11-15 06:41 UTC

README

This package provides a ViewHelper and a Fusion object that work like their original counterparts, but appending cache breaking segment based on the file's md5.

Installation

Require the package via composer:

composer require "opsdev/cache-breaker"

Usage

Use as a Fluid ViewHelper

{namespace opsdev=OpsDev\CacheBreaker\ViewHelpers}
<link rel="stylesheet" href="{opsdev:resource(path: 'path/to/your/file.css', package: 'Vendor.YourPackageName')}" />

Use as a Fusion object

stylesheets.index = T:Tag {
    tagName = 'link'
    attributes {
        href = OpsDev.CacheBreaker:ResourceUri {
            path = 'path/to/your/file.css'
            package = 'Vendor.YourPackageName'
        }
        type = 'text/css'
        rel = 'stylesheet'
    }
}

Credits

The development of this package is partially sponsored by CodeQ web factory and St Philaret Christian Orthodox Institute.

Also the following persons have contributed to this package - thanks!

  • Dimitri Pisarev
  • Simon Schaufelberger