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]
- What’s the best way to search for a UPC code in a Database?
- Optimum way to compare strings in JavaScript?
- How can you profile a Python script?
- Cleanest way to copy a constant size array in c++11
- How to efficiently remove duplicates from an array without using Set
- Big O, how do you calculate/approximate it?
- Why is Fetch task in Hive works faster than Map-only task?
- SQL: How to properly check if a record exists
- Fastest way to put contents of Set
to a single String with words separated by a whitespace? - Steps to optimize WordPress in regard to server load and website speed?
- Are transients garbage collected?
- How to Optimize WP site for millions of posts
- How does object caching work?
- Optimize post insert and delete for bulk operations?
- Should I use Transient API to store HTML String, or Object?
- Will it break my site if I delete all transient records in wp_options table?
- When should I be using the Transients API?
- How to cache json with wp-super cache
- WordPress (MyISAM) database is slow, should I switch to InnoDB?
- How to benchmark a WordPress installation? [closed]
- What is a good alternative to using $content_width for image optimization?
- WP_Query leaking absurd amounts of memory
- Is get_option() faster than accessing get_transient()?
- Cache remote (HTTP) request with Transients API
- What’s a good strategy for planning WordPress DB growth?
- Is there any danger in deleting all transients?
- Set Alias for meta_query arguments in get_posts()
- Make Google index the entire post if it is separated into several pages
- How do I optimize a custom post type admin page with 25,000 posts?
- Separate Database Tables For Different Post Types
- Best practices for using the transients API
- Are transients private or public?
- How to prevent execution of default query, while preserving ability to use WP_Query in template?
- Why are transients cleared prematurely?
- Scaling a WP eCommerce site
- Using transients in conjunction with memcached
- Get a list of existing transients
- Safe to disable wptexturize?
- wp-cron.php – How are WP’s Cron transients removed?
- Do WordPress’ cron’s clean up expired transients?
- Storing posts social counters by using transient api
- Using a wildcard with delete_transient()
- Does set_transient() overwrite/update transient option with same key?
- Running WordPress on low-end hardware/resources?
- Optimize Multiple Taxonomy Term MySQL Query?
- Does using set_transient() function can lead to MySQL problems?
- Where should I host my images?
- Website is slow: advice on optimization
- Fallback when Transient API fails
- Why does WordPress create two transients with the same name when I specify timeout value?
- Preventing YouTube embeds loading multiple instances of player JS?
- How to delete cached transients from a widget instance properly?
- How to save new transients if query changes?
- Fragment caching increasing database queries
- Should I store external API data in my WP database or keep it as a transient?
- WordPress transients for a shortcode
- Integrating WP-TLC-Transients with WordPress – Where to Begin?
- How to purge all transient caches?
- How to delete a transient on post/page publish?
- Is checking whether the blog is installed necessary?
- Is priming a Transient Cache possible?
- How to remove in the wordpress database all posts revisions except the last three?
- Easy way to process search results before displaying
- Should the caching of WordPress menus be specific to each page?
- Speeding Up Bulk Post Creation – wp_insert_post & update_post_meta
- How to properly insert a stylesheet in wp_head
- Long option names fail silently?
- Use Transient API to cache queries for all posts in all categories?
- Looping through posts per category gives same posts for each category
- How to make sure that only one wp_cron() runs at a time?
- Transients vs CRON +Custom Fields: Caching Data Per Post
- How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?
- Transient not working for custom loops
- Settings to get the most out of W3 Total Cache
- How to solve slow WordPress site caused by attachment_metadata
- Minimal WordPress load for only `get_option` to work (because ajax…)
- WP_Cron doesn’t do the job: Multisite stats
- Most efficient way to list all categories and display a post for each of them?