Are PHP redirects and ‘wp_redirect()’s being cached?
-
Hi,
I have a particular situation where some pages are accessible for visitors, but if that visitor has a certain propriety they are redirected away from that page to a different one.
Let’s say you want to access /something as a regular visitor, that will work fine. But if you want to access /something as a visitor with a certain cookie you will be sent to /something-else.
I use wp_rediect() for that and I feel like this behavior gets cached. If I clear the cache (fresh cache now on the site) and a user with that particular cookie gets on the /something is sent to /something-else. Next time a normal visitor gets to /something they are sent to /something-else, giving me the impression that the redirect is cached from the first user.
I tried adding nocache_headers before the wp_redirect(), but doesn’t seem to change anything.
Of course, I could do the redirects in JS and get past this, but I don’t want to actually load the page and do the redirect like that.
Is this something that can be adjusted from W3 settings or am I missing something?
Thanks!
- The topic ‘Are PHP redirects and ‘wp_redirect()’s being cached?’ is closed to new replies.