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?
- How To Use WP_Query To Get The Custom Post type Posts With Keywords
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- WP_Query with child element
- Custom Theme Building & Permalinks
- Include post_status check within $wpdb query
- Pagination returns 404 after page 20
- How to order by datediff in WP loop?
- Select posts wich has no relationship in custom taxonomy
- Query with two posttypes and two different meta_keys
- Custom query for tag and custom tag from 2 post type
- Sort by meta key within same day
- wpdb get_results() returns only 2 rows
- Duplicates When using Nested WP_Query
- meta_query not working with the_content()
- 3 wp_query on one page with pagination for last query
- Querying posts with meta key and meta value not returning anything
- Problems with WP_Query, Loop, a condition and Posts per Page
- WP_Query: Meta_Query with serialized value (or a workaround)
- how to exclude store in clipper theme wordpress code php
- Find by post_meta, then sort by post_meta, then sort by date (wp_posts)
- Query All Attachments and Order by Parent Publish Date
- How To Query All Attachment Images Found In Post Galleries
- Custom pagination (Title, date and teaser)
- WP_Query using meta_query with LIKE doesn’t return what it should
- Multiple tax_queries: display posts titles from several custom taxonomie
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Using URL variables on a custom WP_Query
- Show recent posts from excluded category
- Sorting posts by meta values: 2 different orders
- Ordering Posts by parent category, name ascending
- Escaping WP_Query tax_query when term has special character(s)
- How to get hierarchical number of custom taxanomy
- Use not custom fields in get_posts() meta_query?
- Query posts in current category but not attachment format
- Showing Children of page by name
- WP_Query for liked posts is showing all posts if none are liked
- WP_Query with Pagination and orderby meta_value_num showing duplicates
- Orderby Date and Category
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- Filter posts/pages by user_role array
- WP_Query always returning the last custom post
- What method does this eventually call: do_action_ref_array( ‘parse_query’, array( &$this ) );
- WP_query issue with no posts
- WP_Query secondary query failing