To improve read performance on metadata, get_metadata()
pulls all metakeys into a cache that is stored in memory, then on subsequent calls, pulls from that cache array.
In simple cases, this functionality is beneficial to performance, however, meta values are stored as MySQL LONGTEXT, with a maximum size of 4GB. In rare situations, the meta table may be used to store large amounts of data, that needs to only be accessed infrequently, or a large quantity of smaller metafields.
Especially when taking into account that featured image is stored as post_meta, meaning that every archive page caches all meta values for several posts, there exist situations where this metacache can lead to slow data retrieval and possibly memory exhaustion.
In a perfect world, I would recommend two filters on the metacache functionality, that would implement a whitelist and a blacklist of fields to cache. These filters would be run in realtime, so that users could choose to whitelist or blacklist different fields, based on the context. (This last part might require storing a context string in the cache key, to prevent issues with persistent caches like redis).
Read-only archive: Issues · ClassicPress/ClassicPress · GitHub
Author: Greg Schoppe
Vote count: 5
Status: open
Tags:
- request-add-feature
No comments posted.