• Resolved Max Lyuchin

    (@cadic)


    We are facing with the redirect cache issue.

    To reproduce in Chrome:

    • Open the /dashboard/order/ page while being non-logged.
    • The website redirects you to the login page which is /my-account/.
    • Enter your credentials and log in.
    • Navigate back to the orders page, Chrome performs cached redirect to “My Account” page again.

    I know there is one-time fix to clear the browser cache, but the desired behaviour is not to cache redirects at all.

    Could be fixed on 2.4.7 adding nocache_headers() before the redirect in WCV_Vendor_Dashboard::check_access():

    --- a/classes/front/dashboard/class-vendor-dashboard.php
    +++ b/classes/front/dashboard/class-vendor-dashboard.php
    @@ -240,6 +240,11 @@ class WCV_Vendor_Dashboard {
     
                    if ( $vendor_dashboard_page && is_page( $vendor_dashboard_page ) || $shop_settings_page && is_page( $shop_settings_page ) ) {
                            if ( ! is_user_logged_in() ) {
    +                               if ( function_exists( 'wc_nocache_headers' ) ) {
    +                                       wc_nocache_headers();
    +                               } else {
    +                                       nocache_headers();
    +                               }
                                    wp_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ), 303 );
                                    exit;
                            }

Viewing 1 replies (of 1 total)
  • Plugin Support Mark Kevin

    (@mkesteban08)

    Hi Max,

    Good day, and thanks for writing in.

    I tried following the steps you provided on how you encountered this issue on my test site, but it seems that I was unable to replicate it. The redirection was properly done. Here’s a short screen recording when I tested this:
    https://share.getcloudapp.com/X6u7Z54g

    This could be isolated on your site, and might be due to some caching mechanism that you are using within it. Thanks for your kind understanding.

    We’ll be sure to keep our eyes peeled for similar reports, and we’ll also take note of the snippet that you provided.

    Please let me know if you have other questions, and I’ll be glad to help you with them.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect Cache issue’ is closed to new replies.