LiipImagineBundle icon indicating copy to clipboard operation
LiipImagineBundle copied to clipboard

Possible to dynamically define cache directory?

Open benr77 opened this issue 2 years ago • 1 comments

How would I go about setting up a dynamic cache directory? e.g.

    resolvers:
        media_cache:
            flysystem:
                filesystem_service: oneup_flysystem.media_filesystem
                cache_prefix: '_cache/<INSERT DYNAMIC VALUE HERE>'

Is there a service I can override perhaps?

Thanks

benr77 avatar Jan 12 '23 08:01 benr77

is the prefix you need so dynamic that you can not determine the value when symfony cache is built, and you also can't use a system environment variable? that would be doable with normal symfony configuration features.

as this is referencing a flysystem service name, you could write a flysystem adapter that decorates the filesystem adapater of flysystem and adds the dynamic prefix to all paths. the path would then be handled inside the flysystem adapter and liip imagine would not need to be aware of it. would that work?

dbu avatar Jan 23 '23 11:01 dbu