-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
[5.x] Reduce the number of times the fieldsCache
is reset
#9585
[5.x] Reduce the number of times the fieldsCache
is reset
#9585
Conversation
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.
Please target master
and adjust the PR title to show [5.x]
.
fieldsCache
is resetfieldsCache
is reset
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.
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.
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? |
This PR reduces number of times the
fieldsCache
is reset inside theBlueprint
class. 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
fieldsCache
is reset, but wouldn't mind this being sanity-checked 🙂