Uh oh!
There was an error while loading. Please reload this page.
[5.x] Reduce the number of times the fieldsCache is reset - #9585
Merged
jasonvarga merged 9 commits intoApr 16, 2024
Conversation
JohnathonKoster
marked this pull request as draft
February 25, 2024 17:12
JohnathonKoster
marked this pull request as ready for review
February 25, 2024 20:30
37 tasks
jasonvarga
previously requested changes
Mar 7, 2024
jasonvarga
left a comment
Member
There was a problem hiding this comment.
Please target master and adjust the PR title to show [5.x].
fieldsCache is resetfieldsCache is resetjasonvarga
approved these changes
Apr 15, 2024
jasonvarga
left a comment
Member
There was a problem hiding this comment.
The /references page of the docs will reset 410 times and with this PR it drops down to 153. The home page goes from 96 to 21.
I don't see any noticeable difference in load times, but this PR is only a handful of lines now so I don't think it hurts.
aerni
commented
May 10, 2024
Contributor
This PR causes some major issues when extending blueprints in my Advanced SEO addon. I haven't quite figured out at what point the caching is causing issues, but removing the lines of this PR fixes it. I'm not sure what's the best way to move forward? |
jasonvarga pushed a commit
that referenced
this pull request
May 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR reduces number of times the
fieldsCacheis reset inside theBlueprintclass. If the new parent has the same blueprint has the previous parent, it will continue to reuse those fields instead of clearing the cache every time.Note: The following logic (https://github.com/statamic/cms/pull/9585/files#diff-00e780e9caacd1aa9dcb1834686226b1818cc7c99fc24445a2057d09df87e755R629) has been successful in reducing the number of times the
fieldsCacheis reset, but wouldn't mind this being sanity-checked 🙂