vivomedia/neos-asset-collection-cache-flusher

Cache flusher for Neos Assets and AssetCollections

1.0.0 2023-06-27 12:14 UTC

This package is auto-updated.

Last update: 2024-11-27 15:43:06 UTC


README

Latest Stable Version Total Downloads License

This package provides functionality to flush asset and asset collection caches on changes to themselves or there containing assets.

Install

Install with composer

composer require vivomedia/neos-asset-collection-cache-flusher 

Usage

Asset

prototype(SomePackage:Asset) < prototype(Neos.Neos:ContentComponent) {

    renderer = afx`
        ...
    `

    @cache {
        mode = 'cached'
        entryIdentifier {
            asset = ${q(node).property('asset').identifier} // or some other identifier
        }

        entryTags {
            asset = ${'Asset_' + q(node).property('asset').identifier}
        }
    }
}

AssetCollection

prototype(SomePackage:AssetCollection) < prototype(Neos.Neos:ContentComponent) {

    renderer = afx`
        ...
    `

    @cache {
        mode = 'cached'
        entryIdentifier {
            collection = ${q(node).property('assetCollection')} // or some other identifier
        }

        entryTags {
            collection = ${'AssetCollection_' + q(node).property('assetCollection')}
        }
    }
}