The rule of thumb is not to do any caching, except for object caching, for logged in users. Actually IIRC object caching will give you exactly what you want.
But if you have to do it your way, you should make your cache keys to be based on the query and have different cache for different queries. A similar but maybe easier to grasp idea is do “group” users based on their settings and hold a cache for each group.
And btw transients are the wrong tool for caching, or to say it better, their use do not exempt you from doing cache invalidation as you usually don’t want a situation were you sent a notification about new post but no one can read it because the cache is stale.
Related Posts:
- WP_Query Performance Issues with meta_query
- Differences Between WP_Query() and get_posts() for Querying Posts?
- Should I use Transients with W3 Total Cache APC Caching? [closed]
- What is the most efficient way of querying posts based on visits and date for current day?
- Is it true $wpdb->get_results is faster than WP_Query in most cases?
- Slow SQL_CALC_FOUND_ROWS Query
- get_the_title($postID) OR get_the_title()?
- Use Transient API to cache queries for all posts in all categories?
- Stop all SQL_CALC_FOUND_ROWS wordpress queries
- Transient pagination not working properly
- Slow speed and high CPU usage for my code. How to improve it?
- Multiple queries on Home Page – page load/site speed issue
- wp_transients | wp_object_cache VS SESSIONS & Cookies?
- Transient caching for wp query
- Too many posts cause slow load when paginating
- WP_Query times out
- Improve wp query perfomance on large db
- Minimize database queries to user tables?
- reducing the amount of wp_query calls
- Set Transient does nothing
- Store sticky post’s ids in a transient
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- Use more than one query, but prevent duplicates – at scale!
- Is it a good idea to improve meta query performance by adding tax query?
- Slow page loads due to WordPress Core Query
- Display tags with random thumbnail from selection of posts with that tag
- Should wp_query automatic meta and term cache priming be used in an enviroment with an object caching
- Transient not behaving as expected
- Loop Performance > JSON files vs. WP_Query vs. REST API
- How to increase load time of an archive/search page (WP_Query)
- use of 10 new WP_Query : loading too slow (with url) [closed]
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- Transients with dynamic WP_Query
- How to cache wp_query with pagination using transients?
- Transient api Caches confused
- Using Transients
- How to avoid filling up an array each time I run a WP_query?
- I am officially missing something about transient posts
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Which is from this queries is more faster
- Disable (or limit) queries when certain content (or data) is not needed (or showed)
- Save large WP_Query to transient === false
- Check the stored / cached WP_Query with transients on post change
- Unusual high query of user meta data
- update_post_meta performance in a loop woocommerce
- update_post_meta performance in a loop woocommerce
- WP_Term_Query->get_terms() very slow query for WordPress filter
- Showing the correct number of posts_per_page when avoiding the use of post__not_in
- Calculating efficiently on large amount of data generated by wp_query
- Hi , i am trying to set the post for 24 hours and with it will be changed
- Website goes slow down after importing long database
- Set Transient on CPT
- Optimising amount of calls to custom fields
- Post OrderBy slow performance
- how to use transient method?
- How to cache wordpress get_posts query using transients?
- Posts with at least 3 tags of a list of tags
- Get post count of current loop when using multiple queries on one page
- Use WP_Query with a custom SQL query
- Pagination not working for Custom search form & custom result template
- Using next/previous_posts_link with customised search
- Is temporarily overwriting $wp_query a bad idea?
- Array Chunks and Inserting Varying HTML in WP_Query
- Filter user list that meta_value is empty
- Query wp_usermeta alongside wp_users
- How to output different posts per page?
- ACF – Get lowest & highest value from field
- What format does the meta_query TIME type require?
- wp_query add arguments using array_push if variable met
- tax_query: Order by slug?
- WP_Query filter and order by meta ordering by wrong joined table
- WP_Query last five posts, simply ordered by meta_value
- WP_Query “OR”: Find posts by ID, Name or Post Title?
- Querying A Post That Includes Two Taxonomies Using JSON Rest API
- WP_Query condition affects posts_per_page count
- Set global $wp_query/$post variable for dynamic page generation
- slow WP_Query for non-admin user
- Changing sort order for presentation by Jetpack infinite scroll
- How to search for posts given post_content AND post_excerpt using WP_Query?
- WP_Query Attachment adds additional attachment count and need to link attachment to post url
- Does the WP_Query ‘private’ argument for post status only apply to privately published content?
- Query most popular terms by taxonomy over 2 week period
- WordPress posts for multiple years
- Filter posts by comparing custom meta value against postdate
- Query posts that contain video?
- How to exclude Sticky from Recent Post?
- Display if author page is author page of current user
- get_query_var always returns the default value
- Modify WP_Query using pre_get_posts but only for frontend query?
- parse_tax_query causing Navigation Menu To Disappear
- the_post_thumbnail do 2 queries. How to optimize
- Creating ‘posts page’ loop based on the page itself
- Can’t get term id for category archive
- How to get_comments() ordered by date and parent?
- WP Query filters active on wrong query
- Not able to fetch woocommerce variation sales products for particular category products
- Global page ID variable empty error
- WP Query with sticky posts and tax_query
- Query posts by custom fields
- WordPress pagination returns the same posts