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

Follow up performance improvements #325

Merged
merged 1 commit into from
May 21, 2024
Merged

Conversation

andybroomfield
Copy link
Contributor

Remove protected array for current banners and move the cache contexts
into th build method. Also amend the kernal test to account for #cache
inside the render array.

Remove protected array for current banners and move the cache contexts
into th build method. Also amend the kernal test to account for #cache
inside the render array.
@andybroomfield
Copy link
Contributor Author

@rupertj have managed to remove the need for storing current alert banners as a class property. Turns out it's not stored anyway between the build and getCacheContexts methods, so just applied it to the build render array.

@rupertj
Copy link
Member

rupertj commented May 21, 2024

Looks good, although it'd be better to use CacheableMetadata, as that'd add all the relevant metadata from the node, not just contexts. (I'm thinking cache tags should come across too).

@andybroomfield
Copy link
Contributor Author

@rupertj Yeah, I was looking at that, though we already have a getCacheTags and I think they should bubble. I can look at those in part 3 along with the manager service.

@rupertj
Copy link
Member

rupertj commented May 21, 2024

I've just realised we're talking about a custom entity, and I don't think it implements the interface required to use CacheableMetadata right now, so doing it like this MR does is best for now anyway.

@finnlewis finnlewis merged commit c762719 into 1.x May 21, 2024
8 checks passed
@finnlewis finnlewis deleted the fix/1.x-performance-redux branch May 21, 2024 11:11
@andybroomfield andybroomfield mentioned this pull request May 21, 2024
andybroomfield added a commit that referenced this pull request May 31, 2024
Fix #327

Part revert #325
Restores the getCacheContexts method as that is what is called each time
to determine the cache contexts each time the block is rendered.
andybroomfield added a commit that referenced this pull request May 31, 2024
Fix #327

Part revert #325
Restores the getCacheContexts method as that is what is called each time
to determine the cache contexts each time the block is rendered.
andybroomfield added a commit that referenced this pull request May 31, 2024
Fix #327

Part revert #325
Restores the getCacheContexts method as that is what is called each time
to determine the cache contexts each time the block is rendered.
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.

None yet

3 participants