-
Notifications
You must be signed in to change notification settings - Fork 66
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
added cache-invalidator-listener service #42
added cache-invalidator-listener service #42
Conversation
if ($document instanceof Image) { | ||
// TODO: this does not work, what do we need to pass to manager->remove? | ||
// TODO: can we invalidate all caches? otherwise inject filter name(s)? by config | ||
$this->manager->remove($document->getId(), 'image_upload_thumbnail'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 0.9.x you need to resolve the name first, see liip/LiipImagineBundle#135 (comment)
$path = $this->manager->resolve($this->container->get('request'), $document->getId(), 'image_upload_thumbnail')->getTargetUrl(); | ||
// TODO: this might not be needed https://github.com/liip/LiipImagineBundle/issues/162 | ||
if (false !== strpos($path, $filter)) { | ||
$path = substr($path, strpos($path, $filter) + strlen($filter)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if i get a reply on that issue today, i will clean this up if possible.
…ener added cache-invalidator-listener service
also cleaned up the configuration. you now need to explicitly enable imagine to have this block. the full config options for imagine are now
guess i have to update the doc as well... /cc @rryter @elHornair |
we started with a listener service to go with the image document. whenever the image changes, the imagine cache should be invalidated.