Title: Related posts cache
Last modified: February 24, 2021

---

# Related posts cache

 *  Resolved [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/related-posts-cache/)
 * Hello!
 * First of all, thank you for great plugin! No doubt, this is the best related 
   posts plugin for WordPress. Special thanks that it is absolutely free. 🙂
 * I’m a bit confused with cache options. Some questions about them.
 * 1. Is cache enabled by default and options “Cache posts only” or “Cache HTML 
   output” just change its type? Or should I mark one of this options for enabling
   related posts cache? If cache enabled by default, is it possible to disable it?
 * 2. What is the lifetime of the cache? I mean if, for example, I publish 50 posts,
   turn on “Cache HTML output” and than publish 10 more posts, when last 10 posts
   will be shown in related posts lists for first 50 posts? And how can I clean 
   cache manually, if I need this?
 * 3. What cache option do you recommend to use with global cache plugin (like W3
   Total Cache or else)?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/related-posts-cache/#post-14096319)
 * 1. It is only enabled when you pick one of the two options. The posts only option
   saves just the post IDs and generates the HTML when called. The other option 
   caches the entire HTML output and hence is massively efficient vs the previous
   one.
    Selecting posts only will ignore the other option
 * 2. It’s one month by default but can be overridden by setting a custom time for
   [CRP_CACHE_TIME](https://github.com/WebberZone/contextual-related-posts/blob/v3.0.5/contextual-related-posts.php#L98).
   
   You can clean the cache manually in the Tools page or alternatively saving the
   settings page. Editing and saving a post will clear the cache for that specific
   post.
 * 3. I’d recommend using the Cache HTML as it does speed up the posts. Although
   if you’ve set a global caching plugin and it caches the entire HTML content, 
   you might not need to run the CRP cache. As far as I’m aware, it shouldn’t conflict
   with the cache – but clearing the cache of these plugins will not automatically
   clear CRP cache.
 *  Thread Starter [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/related-posts-cache/#post-14096535)
 * Thank you for quick answer. Now everything clear with cache mechanic. And looks
   like I didn’t check link “Visit the Tools page” before ask – my bad. 🙂
 * Just a small suggestion. Controlling cache logic a bit hard to understand at 
   option page. It could be much more understandable, if you make there 1 checkbox“
   Enable cache” and 1 radio button “Relative posts ID | Relative posts HTML” (which
   works only if checkbox is marked). Or just 1 radio button “No cache | Cache relative
   posts ID | Cache relative posts HTML”. But not 2 checkboxes, which could be marked(
   but not work) both and say nothing about default status of cache. 🙂
 * And ability to changing cache lifetime in options could be very usefull. Not 
   a lot of bloggers ready to work with php. 🙂 But sometimes a lot of new posts
   are added everyday, sometimes – just a few per month. Different situation needs
   different cache lifetime.
    -  This reply was modified 5 years, 3 months ago by [Roman](https://wordpress.org/support/users/vladroman/).
    -  This reply was modified 5 years, 3 months ago by [Roman](https://wordpress.org/support/users/vladroman/).
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/related-posts-cache/#post-14098188)
 * The two checkboxes are actually because of legacy reasons. The Cache HTML came
   first and after some requests the cache posts came after that. Given the wide
   usage of the plugin I didn’t want to touch that functionality.
 * I agree with your approach of a checkbox and radios but will require me to move
   and migrate settings which I’m always reluctant to touch as it can break functionality.
   But, it’s definitely under consideration and I’ll try to be gentle when I do 
   make this change.
 * On lifetime, I’ve intentionally kept it out of the options as I’m trying to limit
   how many additional ones I throw in there and separately most users are agnostic.
   Prior to V3 which was released in Jan there was no expiry and no questions or
   requests for that.
    Also the related posts generation is heavy which is why I
   set it to a month. On larger blogs you risk increasing load massively if set 
   too short. Setting the cache time via the constant will be a one time fix. It’s
   also why I haven’t publicised this feature massively other than the mention in
   the v3.0 release post

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Related posts cache’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/related-posts-cache/#post-14098188)
 * Status: resolved