Try bypassing the cache for CSS classes when the pseuds are already loaded
Description
The code for generating the CSS classes for a work uses a cache, resulting in 20 separate memcached gets for all work index pages.
Once pseuds are loaded on all work indexes (), it might be faster to rewrite the css_classes_for_creation_blurb function to use pseuds.pluck(:user_id).uniq instead of users.pluck(:id).uniq, and bypass the cache when the pseuds are loaded (or just skip the cache altogether). Let's try it, preferably in a release without any other performance changes, so that it’s easier to check if it’s an improvement.
Testing Instructions
Mute a user who has some public works, and view their /users/NAME/works page to make sure that all the works are invisible.
The code for generating the CSS classes for a work uses a cache, resulting in 20 separate memcached gets for all work index pages.
Once pseuds are loaded on all work indexes (), it might be faster to rewrite the
css_classes_for_creation_blurb
function to usepseuds.pluck(:user_id).uniq
instead ofusers.pluck(:id).uniq
, and bypass the cache when the pseuds are loaded (or just skip the cache altogether). Let's try it, preferably in a release without any other performance changes, so that it’s easier to check if it’s an improvement.Testing Instructions
Mute a user who has some public works, and view their
/users/NAME/works
page to make sure that all the works are invisible.