Tuesday, 3 September 2013

Strange website redirect issue on mobile browser that's influenced by cache

Strange website redirect issue on mobile browser that's influenced by cache

I'm at a loss here.
I have a new Wordpress site at synergration.com.
If you access it on a mobile device (phone, not tablet) it will generally
load fine the first time. Once you click on to another page and/or reload
the home page it jumps into a redirect loop indefinitely attempting to
reload the same page over and over and over...
I've weeded through the code and have been unable to find any JS
redirects. I've also contacted the theme developer and they've been unable
to help.
This only became an issue when I started hosting on WP Engine. They use
some advanced caching that seems to be the culprit here as when I test the
mobile site on their staging server (where no cacheing exists) it loads
fine.
I contacted WPEngine about it and this was their reply:
This is being caused by our caching systems that run on our platform. It
looks like the theme is handling an internal redirect that detects the
user agent (desktop or mobile) and redirects the visitor to the
appropriate site based on that information. However, the redirect is
getting stuck in cache, causing the mobile version to load in an infinite
loop. Unfortunately, we don't have an easy solution for this. If this were
only one part of the site, we could just exempt that part of the site from
caching, but because it covers the whole site, exempting from caching
isn't an option. Our staging area is exempt from all caching, which is why
it's working normally there. (The old host was most-likely using a
non-cached environment, which is why you didn't see this issue there). I
would contact the theme developer and ask them if they've ever come across
this issue before. There's a good chance they have, and they might have a
clever solution as a work-around. You might have the option of disabling
the mobile routing, which would solve the redirect issue, though mobile
devices would load the full version of the site rather than the
slimmed-down mobile version.
As noted above, the theme developer didn't have any solution and I'm back
at square one so I figured I'd reach out to stack to see if ya'll had any
ideas.

No comments:

Post a Comment