Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to dynamically define cache directory? #1497

Open
benr77 opened this issue Jan 12, 2023 · 1 comment
Open

Possible to dynamically define cache directory? #1497

benr77 opened this issue Jan 12, 2023 · 1 comment

Comments

@benr77
Copy link

benr77 commented Jan 12, 2023

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

@dbu
Copy link
Member

dbu commented Jan 23, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants