Actually, doing it for menu is good, you can even store entire HTML output and cut not only queries, but processing time too. Additionally, you can use WP_Object_Cache directly in conjunction with Redis/Memcached backend and avoid even single DB query for the transient itself.
Re comments – they do change, so running WP_Comment_Query is unavoidable. However, you can cache them as well, for some short amount of time. Say, 5 minutes. In this case, you need to find the balance between how much speed boost you gain and the delay before users will see their newly made comments.
Rule of thumb is, cache when needed, when it gives you positive impact and does not introduce negative impact.
WordPress already does great job in caching most important things (including menu items) – just put the object cache class in WP-content and add object cache backend on your server.
Related Posts:
- What is copy-on-write?
- What is the purpose of the “role” attribute in HTML?
- Most efficient way to increment a Map value in Java
- Image rotation algorithm
- Refactoring WordPress to improve memory performance [closed]
- Optimizing a Proximity-based Store Location Search on a Shared Web Host?
- Why is home (a lot) slower than other pages?
- Long Waiting Times on GoDaddy? [closed]
- Is there a way to measure server resource (CPU) usage by WP plugins?
- wordpress with 1.5 million posts
- Any suggestions on how to make this function more efficient or more generally useful?
- better wordpress minify problem
- Compressing JS and CSS
- Is there a way to ensure local fonts load from CDN when CDN is enabled?
- Disable Garbage Collection? [closed]
- Does WP Super Cache really compress my pages? [closed]
- How to prevent Vimeo duplicate requests?
- Need to optimize wordpress websites on google pageinsight
- Number of queries in wordpress
- Combine several CSS files into one
- My website is slow on the initial load
- What are some ways to speed up a WordPress site that most people don’t know? [closed]
- Optimum way to compare strings in JavaScript?
- SQL: How to properly check if a record exists
- Are transients garbage collected?
- Is get_option() faster than accessing get_transient()?
- Set Alias for meta_query arguments in get_posts()
- How do I optimize a custom post type admin page with 25,000 posts?
- wp-cron.php – How are WP’s Cron transients removed?
- Optimize Multiple Taxonomy Term MySQL Query?
- Where should I host my images?
- Should I store external API data in my WP database or keep it as a transient?
- WordPress transients for a shortcode
- Is checking whether the blog is installed necessary?
- How to remove in the wordpress database all posts revisions except the last three?
- Easy way to process search results before displaying
- Speeding Up Bulk Post Creation – wp_insert_post & update_post_meta
- How to properly insert a stylesheet in wp_head
- Transients vs CRON +Custom Fields: Caching Data Per Post
- WP_Cron doesn’t do the job: Multisite stats
- Storing an XML Response (Transient)?
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- What to use , set_transient, set_option or file system? [closed]
- Transient caching for wp query
- Transient storage location? database/xcache/w3Total Cache?
- How to delete transients written by fetch_feed()?
- Optimizing WordPress’s styles and scripts
- What’s faster? One big query, or several smaller ones?
- How to clear Transients on all sites in Multi Sites environment
- Minimize database queries to user tables?
- Is this the proper usage of creating / using a transient?
- WP Optimization: Removing Orphaned wp_options (especially the autoload ones)
- Store sticky post’s ids in a transient
- WP Responsive images – upload custom image sizes
- How can I use PurifyCSS to clean WordPress style.css?
- How to Appease the Google PageSpeed Gods with regards to image optimization?
- Database Queries Optimization with new WP_Query
- Transients are not expiring as expected in simple custom plugin
- How to optimize multiple WP_Query() calls on one page?
- Store a default value for a transient on plugin activation
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- WordPress backend delay by server side HTTP Request
- What would Repair and Optimize WordPress Database do?
- How to decode wordpress transient cache stored in database?
- wp_options flooded with transient API entires
- Transients API conditional
- Optimising a big WordPress site
- How to set a Cookie-Free Domain with WordPress?
- Compare custom taxonomies of updated post (or new post) [Updated with progress]
- Prioritize visible content – Page speed issue on Google insights
- WordPress network vs Separate installs
- Compare transient data with a meta box value
- Using Transients
- delete_transient on click inside a widget form
- Optimizing function that automatically creates internal links based on post title string
- A faster way to query custom post types with multiple conditions?
- I am officially missing something about transient posts
- Obfuscate links (for SEO purpose) [closed]
- Optimal image size for wordpress?
- Using `set_transient()` when saving a custom post type
- Transient is never set. Why?
- Deferring Script wp-i18n causes a console error ‘wp is not defined’ – Gravityforms
- Change WooCommerce product and variation prices programatically without affecting performance
- Google Page Speed
- What is the best way to host a site with many images without it being too slow?
- Set user status to absent on WordPress
- How can I stop widgets from re-executing every time I access the logged-in homepage?
- Above the fold plugin error “The Proxy Cache directory contains n cache entries.”
- Set transient name
- How to optimise this database query?
- Hi , i am trying to set the post for 24 hours and with it will be changed
- Is it inefficient to repeat a Shortcode 100 times on a page?
- How to use a transient inside WP_User_Query
- Delete Transient when clicking ‘Save Changes’ on options page
- Optimising amount of calls to custom fields
- how to use transient method?
- echo vs output variable [closed]
- WordPress Customise
- Best way to search and replace within serialized database strings?
- How to create a transient that persists the data for the whole duration of the expiration, even when object cache is enabled?