#15715 closed enhancement (invalid)
Add page load caching to get_users_of_blog()
| Reported by: | yoavf | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Users | Version: | 3.0.2 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description (last modified by )
Theme authors often use get_users_of_blog() in various area to style/present blog authors. Unfortunately, the query resulting from this function isn't cached, and can be quite expensive in a large multisite environment.
Proposed patch adds simple caching to get_users_of_blog()
Attachments (1)
Change History (8)
#2
@
16 years ago
- Keywords needs-patch added; has-patch removed
- Milestone Awaiting Review → Future Release
- Version → 3.0.2
#3
@
16 years ago
This cache should only last for the page load so doesn't need invalidation.
It just needs registering as non-persistent in the right places with wp_cache_add_non_persistent_groups
#5
@
16 years ago
Rethinking this:
get_users_of_blog() returns the complete users objects for every users, yet scenarios where only user ids/nicenames/email are required, are the reason I opened this ticket in the first place.
A better solution would probably be to have a function that can return specific columns of the user table.
Does that make sense?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The cache also needs to be invalidated.