[wp-trac] [WordPress Trac] #50422: Prevent Browser Caching From Getting Involved With wp_redirect and wp_safe_redirect (Leaving the Browser to Purely Honor the Redirect Code Used)

WordPress Trac noreply at wordpress.org
Fri Mar 14 10:59:44 UTC 2025


#50422: Prevent Browser Caching From Getting Involved With wp_redirect and
wp_safe_redirect (Leaving the Browser to Purely Honor the Redirect Code
Used)
-------------------------------------+------------------------------
 Reporter:  KZeni                    |       Owner:  (none)
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  5.4.2
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:
-------------------------------------+------------------------------

Comment (by shoelaced):

 Replying to [comment:6 KZeni]:
 > It really appears to be such a simple & harmless streamlining of this
 function that only makes things more reliable

 I agree — the only reason I discovered I was having the issue at all was
 purely by chance, because it worked fine without `nocache_headers()` in
 most cases while I was working on it. I could easily see someone having no
 idea there's an issue until someone complains, and at least in my case, I
 don't even remember how I found this solution.

 In any case, I have it working now and hopefully I'll remember this the
 next time I use a redirect, but it does seem like a simple and sensible
 fix that I hope gets attention.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50422#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list