• Resolved Flegma

    (@flegma)


    Hello,

    we are using WP Rest Cache plugin to cache our REST API responses and they’re getting cached okay. But if we enable the cron that regenerates caches, the URL’s that are being called are wrong (so we get 404’s).
    If i check in the database, it looks okay (request_uri), and also if i do the var_dump to regenerate_expired_caches function, the $result[‘request_uri’] looks fine. Same thing if i manually run the cron with wp-cli.


    But when the URL is called from WordPress, we see 404 in our nginx logs. It usually looks something like:
    domain.com/en//en/wp-json/wp/v2/properties?something=something – this makes a redirect to
    domain.com/en/en/wp-json/wp/v2/properties?something=something which is a 404. Correct URL would be domain.com/en/wp-json/wp/v2/properties?something=somethings, so i think that we get a double WPML language code somewhere.

    Have anyone had any experience with this behavior?


    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Flegma

    (@flegma)

    I figured out that it might be the issue with WPML compatibility.
    When the “Use directory for default language” is enabled, WP REST Cache cron is using double the language code, thus resulting in a 404.

    Any workaround this, other that modifying the plugin itself?

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @flegma

    Thank you for using our plugin!

    I have been able to reproduce the bug and have found a solution. I hope to release a new version of our plugin soon with this fix.

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @flegma

    We just released a new version of our plugin which should solve your issue.

    Thread Starter Flegma

    (@flegma)

    Hello @rockfire,

    i’ve updated plugin on our dev and staging website and it seems to have fixed the issue with 404’s. Ill let you know if i find any more problems, but this looks okay.

    Thanks for a swift response!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cache regeneration Cron – Wrong URL (404)’ is closed to new replies.