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

[Cache] Programmatically manage the cache #1487

Open
homersimpsons opened this issue Sep 23, 2022 · 1 comment
Open

[Cache] Programmatically manage the cache #1487

homersimpsons opened this issue Sep 23, 2022 · 1 comment

Comments

@homersimpsons
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently it seems rather hard to remove or warmup the cache in controllers for example.

Describe the solution you'd like
I would like to have a Service that would mimmic the functionnality on the liip:imagine:cache:remove and liip:imagine:cache:resolve.

Describe alternatives you've considered
Not doing this leads to either:

Additional context
~

@dbu
Copy link
Member

dbu commented Sep 26, 2022

yeah, i agree that a reusable service is best for these kind of things. for the remove command, i am a bit confused as CacheManager::remove already accepts null for the filters and in that case does all filters. so i am not sure why the command is not more straightforward.

for the warmup, i think FilterService should get a new convenience method that takes a list of images and optionally a list of filters (defaulting to all filters if not provided) and do what the ResolveCacheCommand currently does. runCacheImageResolvecontains quite a bit of io as well. if we want to keep that, we'd need to be able to pass a callback function to the FilterService method that is called with an argument for the true / false or the exception that can then do the logging.

i think all of that is possible without BC break, so we can do it in the 2.x branch if you want to.

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