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
Add caching to navigation and snippet controller #112
Conversation
659e839
to
8d26645
Compare
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.
Missing a subscriber which invalidates snippet areas.
Controller/NavigationController.php
Outdated
// 7 days | ||
public const NAVIGATION_CACHE_LIFE_TIME = '604800'; |
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.
Should be configureable.
Controller/SnippetAreaController.php
Outdated
// 7 days | ||
public const SNIPPET_AREA_CACHE_LIFE_TIME = '604800'; |
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.
Should be configureable.
Events::PUBLISH => ['invalidateNavigationContextBeforePublishing', 8192], | ||
Events::UNPUBLISH => ['invalidateNavigationContextBeforeUnpublishing', 8192], | ||
Events::REMOVE => ['invalidateNavigationContextBeforeRemoving', 8192], | ||
Events::REMOVE_LOCALE => ['invalidateNavigationContextBeforeRemovingLocale', 8192], |
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.
This listeners should just collect the data.
And a Flush
method with allow priority should then call the CacheManager.
Do not forget to implement kernel.reset
event to empty the array and empty the array.
Co-authored-by: Alexander Schranz <alexander@sulu.io>
@alexander-schranz do we really need one? At the moment it is working, as soon as the snippet is modified, the tag is invalidated through the default InvalidationSubscriber from the HttpCacheBundle |
@Prokyonn but if a default snippet is changed to another default snippet the cache need to be invalided also. Else you will get a long time the old default snippet. |
3cb7665
to
f36dcb0
Compare
* | ||
* @internal | ||
*/ | ||
class NavigationInvalidationSubscriber implements EventSubscriberInterface |
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.
would add the ResetInterface
here.
Add caching and tag invalidation support for
NavigationController
andSnippetAreaController