• Resolved eddr

    (@eddr)


    Hi

    Tried to add support for WC admin calls, but it doesn’t seem to work. Simple example:

    function test_add_wc_admin_endpoint( $allowed_endpoints ) {

    $allowed_endpoints[‘wc-admin’] = [];
    $allowed_endpoints[‘wc-admin’][] = ‘onboarding/tasks’;
    return $allowed_endpoints;

    }
    add_filter( ‘wp_rest_cache/allowed_endpoints’, ‘test_add_wc_admin_endpoint’, 10, 1);

    Any clue?
    Thanks

    • This topic was modified 1 year, 10 months ago by eddr.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @eddr

    Thank you for using our plugin!

    I have had a look at the code of WooCommerce and see that the endpoint is an authenticated endpoint. Only certain users can access it. So this isn’t an endpoint you want cached, because if it is cached the authentication is no longer validated.

    Thread Starter eddr

    (@eddr)

    Thanks

    Some info is really repetitive. In general I think WP/WC need better management there, but for the meanwhile, is there a way to enable it anyway?
    Out admins use the admin area intensively right when the site is under big sales load, so it makes sense

    Thanks

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @eddr

    I actually got a similar request recently. See my reply here, that is probably how I would do it in your case.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WC Admin rest calls cache ?’ is closed to new replies.