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.
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
Improve caching and logic in get_user_data_from_wp_global_styles. #2414
Improve caching and logic in get_user_data_from_wp_global_styles. #2414
Changes from 6 commits
075d00a
2da31ee
83f9579
82ffd45
95667ce
71bcb6c
478fa51
8bb1cd7
32d7306
7482d90
12e6322
67537a2
0389421
76fd86c
8e567de
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm a little worried about the switch to a non-expiring transient as it could affect sites without a persistent object cache.
Once this is set, it's in the options table and loaded in
alloptions
for life. If the site owner changes theme then the redundant data will remain in their database unless they manually clear it.I am wondering if using the object cache without an expiration time is a better approach. It will at least fall out of persistent caches after a period of being unused.
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.
Valid point, I added back the expiration. But the none persistent object cache, is what I am trying to fix here. We replace 1 call to the option table with 3 calls to database, one for post, post meta and term. As most site run without persistent object cache and theme does change, this is a massive performance win.
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.
Can we set one variable for
wp_get_theme( 'testing' )
and use it?i.e.
This also applies to the other test method.