Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

mindscreen/flow-cachebreak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT license Packagist

Cache Breaking for Flow resources

This package provides a ViewHelper that adds a cache breaking string to resource URIs. The cache breaking string can be updated with a CLI command.

Recommended usage

Replace the default Flow resource.uri ViewHelper with the ViewHelper provided by this package for all resources that should get cache breaking capability:

<link rel="stylesheet" href="{cb:uri.resource(path: 'Build/Styles/Style.css', package: 'My.Package')}" />

You can set far future expires headers for these resources, as the the ViewHelper will add a cache breaking GET parameter to the resource URI.

The GET parameter is only updated when you explicitly flush the Mindscreen_Flow_CacheBreak cache. ./flow flow:cache:flush will not clear this cache, as it is persistent.

As an alternative to cache flushing, you can use the command ./flow cachebreak:update (which does the same thing basically).

You should execute the cachebreak:update command (or the cache flushing) during every deployment (for example as part of your Surf Deployment).