Support » Plugin: Yet Another Related Posts Plugin (YARPP) » How to bypass the cache ?

  • Resolved Ishko



    Thanks for the very nice work on YARPP.

    I have problems with a website using last version of WPML and last version of YARPP. Related posts are messy in foreign languages, as described by other users.

    A fast solution for me would be to bypass the cache – this is a small website with few visitors – but I can’t figure how to do it.

    If I use “define(‘YARPP_CACHE_TYPE’, ‘bypass’)” in wp-config.php, then I have a PHP error : the required file cache-bypass.php doesn’t exist. I can create it but don’t know which code I should include in.

    Can you explain me the nice way to bypass cache ?
    Thanks by advance !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Well,

    I managed to test bypass method.
    (line 29 of class-core.php changed to : $this->cache = new YARPP_Cache_Bypass( $this ); )

    Bad. Every articles of all post types are displayed as related items. The same result can be obtained by using the “postmeta” cache method.
    In default language : no problem, never.

    Flushing the cache before displaying the items seems to resolve the display problem.

    In the file class-core.php, just after line 919 :

    function display_related($reference_ID = null, $args = array(), $echo = true) {

    add :


    Then everything is ok with cache flushed. If the cache has already been saved in the database for the post, it breaks.
    Then YARPP works well with WPML, with cache-table method only, and only if cache is empty at the start of the process.

    Could the problem just rely on the table-cache save process ? Maybe a “simple” solution could be found, but without a good knowledge of YARPP nothing is simple…

    I mark as resolved, initial question is resolved in my case (bypass cache). I add my other question in an already existing post about WPML :

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to bypass the cache ?’ is closed to new replies.