Support » Plugin: Contextual Related Posts » Related posts cache

  • Resolved Roman



    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


    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.
    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


    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 1 month, 2 weeks ago by Roman.
    • This reply was modified 1 month, 2 weeks ago by Roman.
    Plugin Author Ajay


    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)
  • You must be logged in to reply to this topic.