Skip to content

Improved cache-invalidation for categories/tags in excerpt tab #3779

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

Merged

Conversation

wachterjohannes
Copy link
Member

@wachterjohannes wachterjohannes commented Feb 19, 2018

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets none
Related issues/PRs none
License MIT
Documentation PR none

What's in this PR?

This PR uses reference-store of categories and tags to invalidate pages where a smart-content uses tags/categories in the query.

To Do

  • Tests

@wachterjohannes wachterjohannes changed the title Enhancement/excerpt cache invalidation Improved cache-invalidation for categories/tags in excerpt tab Feb 19, 2018
@wachterjohannes wachterjohannes force-pushed the enhancement/excerpt-cache-invalidation branch 5 times, most recently from febe812 to 562210e Compare February 20, 2018 07:45
@wachterjohannes wachterjohannes force-pushed the enhancement/excerpt-cache-invalidation branch from 562210e to ccf04b0 Compare February 20, 2018 10:38
@@ -3,3 +3,4 @@ framework:
storage_id: session.storage.mock_file
profiler:
enabled: false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superfluous newline


if (isset($excerpt['tags'])) {
foreach ($this->tagManager->resolveTagNames($excerpt['tags']) as $tag) {
$this->invalidationHandler->invalidateReference('tag', $tag);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to invalidate the entire tag? Wouldn't it be enough to only invalidate pages which have the resulting pages/snippets/contacts whatever?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to invalidate pages which uses the tag/category (for example as a filter for queries - smart-content in this case).

@wachterjohannes wachterjohannes force-pushed the enhancement/excerpt-cache-invalidation branch from ccf04b0 to b8590e6 Compare February 21, 2018 07:27
public function invalidateReference($alias, $id)
{
foreach ($this->handlers as $handler) {
if (!$handler instanceof HandlerInvalidateStructureInterface) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that check be HandlerInvalidateReferenceInterface?

@danrot
Copy link
Contributor

danrot commented Feb 21, 2018

@trickreich I think you should also do a rebase of your caching PR quite soon, so that you can ask @wachterjohannes for help, because I guess there will be some conflicts here.

@danrot danrot merged commit beff54d into sulu:master Feb 21, 2018
@wachterjohannes wachterjohannes deleted the enhancement/excerpt-cache-invalidation branch February 22, 2018 07:05
@danrot danrot mentioned this pull request Feb 23, 2018
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

Successfully merging this pull request may close these issues.

2 participants