Brion Vibber wrote:
However, we can't just use a User-Agent check in PHP for this, since 90-something percent of the time the PHP scripts are not being executed: the Squid caches respond to most web requests directly.
So what would be required would be some filtering in the caches to check for particular User-Agents or other settings and send them the redirect directly, or send them through to PHP for possible redirection. (Assuming there's no problem with downstream caching, which I think should usually be ok the way we have things marked -- as long as the redirect responses are marked as private-cache or uncacheable.)
A JavaScript hack was quicker to put in place than the cache-level logic, but it was only ever meant as a stopgap.
-- brion vibber (brion @ pobox.com)
I was precisely thinking on this the other day. The javascript is just doing a regex on the user agent, and squid is perfectly capable of doing that.