I have a blog that has over 100 categories. This can generate intense database traffic on the first page load of the site because WP generates a ton of subqueries to flesh out the category children. Two ideas to consider:
First, the function return_categories_list() in admin-functions.php currently has an arbitray LIMIT clause of 100, so not all categories show up in the posting interface. I don’t see a compelling reason to impose this limit, so maybe it can be removed in future versions?
Second, since categories don’t change very often, perhaps the cache could be extended to have a longer-lasting, cross-user (that is, not tied to individual users) cache for category queries. The cache would be deleted whenever categories are inserted/updated/deleted in the admin interface.
The first one is a trivial change. The second requires more thought and I’ve thought about doing it myself, but I don’t want to fork and/or run over someone else’s work.
- The topic ‘Cache details and category sql’ is closed to new replies.