Redirect Cache issue
-
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; }
- Open the
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Redirect Cache issue’ is closed to new replies.