Support » Plugin: WP REST Cache » WP Multilang cache issue Patch

  • Resolved hugomineiro

    (@hugomineiro)


    Hi, thank you for all your work so far with this plugin! You have managed to create a must have plugin for everyone using the WP REST API, without it loading times are horrible.

    I was facing an issue when using the plugin WP Multilang, the cache would be set on the first language visited and served to all languages from then on.

    After looking at your source code I noticed that I was able to patch this very simply by adding the language from the request object.

    trait-controller.php line 47
    $key = $this->get_id( $item ) . “_” . $request[‘lang’];

    I tried looking for the github repo to create a pull request but didn’t find it. Would it be possible to include this on an upcoming version of your plugin?

    Once again, I am really grateful for making the only cache plugin that actually works with the rest api!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Acato

    (@acato)

    Hi @hugomineiro

    Thank you for using our plugin! And your kind words 🙂

    We just released a new version of our plugin. For several reasons and the fact that the Item API Cache wasn’t adding a real performance boost (the real performance boost comes from the Endpoint API Cache), we have decided to remove it completely. So I would say that also solves your problem, right?

    • This reply was modified 11 months, 3 weeks ago by Acato.

    No, I’m facing the same issue with WPML and the latest version of the plugin 2019.4.0, but the workaround suggested by @hugomineiro doesn’t apply anymore, even though URIs differ per language (in our case /wp-json is italian, /en/wp-json is english).
    Hope you could fix the problem!

    Hi @bobo_italy I still haven’t gone around to test the latest version of the plugin. But I think in our case it should solve the problem, as the initial cache would not be set. I have to mention that this is patch is not for WPML but for WP Multilang https://wordpress.org/plugins/wp-multilang/ I found this to be a much better option for our use case.

    Hope you manage to find a solution, I will post the results after we test with this last plugin version. Thanks for the update @acato

    Thanks for the info, I will post a new issue!

    Hi @acato I can confirm that the last version of the plugin solves the language problem for wp-multilang plugin. Thanks for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP Multilang cache issue Patch’ is closed to new replies.