• Resolved waffl

    (@waffl)


    Hello, thank you for the amazing work on this plugin, I’m just having a small problem where I’m trying to call my API without the cached response for a staging site.

    However, I’m running into a strange error where using this parameter causes the request to fail.

    I have a custom endpoint, declared (for example) like so:

    add_action( 'rest_api_init', function () {
      register_rest_route( 'my_custom_example/v1', '/test_endpoint', array(
        'methods' => 'GET',
        'callback' => 'my_custom_test',
      ) );
    });

    If i call the endpoint, domain.com/wp-json/my_custom_example/v1/test_endpoint, it works, but if I call domain.com/wp-json/my_custom_example/v1/test_endpoint?skip_cache=1, I get the following response:

    {“namespace”:”my_custom_example\/v1″,”methods”:[“GET”],”endpoints”:[{“methods”:[“GET”],”args”:[]}],”_links”:{“self”:”https:\/\/domain.com\/wp-json\/my_custom_example\/v1\/test_endpoint”}}

    Adding a / after between the URL and the param causes the regular cached data to return.

    It seems like some sort of routing issue, but I’m not sure how to proceed.

    • This topic was modified 5 years, 4 months ago by waffl.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter waffl

    (@waffl)

    Hm, actually flushing the cache completely seems to have made it work again, I will report back in case the problem reappears.

    Thread Starter waffl

    (@waffl)

    Ok, it’s back. For some reason, this keeps happening at some point and goes away once I click Empty WP REST API Cache

    • This reply was modified 5 years, 4 months ago by waffl.
    Thread Starter waffl

    (@waffl)

    My sincere apologies, I’m actually using the confusingly similarly named but different ‘WP REST API Cache’ Plugin which hasn’t been updated in some time.

    I’ve actually moved to this plugin now and everything is working wonderfully!

    • This reply was modified 5 years, 4 months ago by waffl.
    • This reply was modified 5 years, 4 months ago by waffl.
    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @waffl

    No problem, the plugins are indeed named very similar. That is because it is an obvious name for such a plugin ??

    Very good to hear that moving to our plugin solved your issues! Please let us know if we can be of any assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘skip_cache returns endpoint description instead of data’ is closed to new replies.