Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

301 redirect time

  • 30-08-2012 05:24PM
    #1
    Registered Users, Registered Users 2 Posts: 6,475 ✭✭✭


    I've got a 301 redirect set up to redirect non www versions of pages to www version, using mod_rewrite in the .htaccess.

    Doing some performance testing, and I've noticed the redirect is taking 400-500ms to return.

    i.e. looking at the waterfall chart on webpagetest.org, there's an initial connect for the non-www page, there's maybe 100ms total for DNS lookup and connection, then 300-400ms for TTFB. And that's before the www connection can start, so it's effective adding half a second to every non-www request.

    Does this seem high? Surely the server shouldn't be doing anything but instantly waving it's hand saying "this is not the page you are looking for"?
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 16,415 ✭✭✭✭Trojan


    You should only get 1 non-www request, because it's 301 redirect - the only ways to generate that are a type-in or an incorrect link (rare - most linkers will use copy/paste). I wouldn't worry about it if it's only the non-www that's delayed and if it's only 300-400ms.

    On the other hand, a high TTFB in general is something you should talk to your host about.


  • Registered Users, Registered Users 2 Posts: 6,475 ✭✭✭MOH


    I was more worried that if it's taking a long time just to do the redirect, that could be symptomatic of an overall issue which was slowing all requests.

    I just checked a static site on the same server, and the redirect TTFB was under 70 ms, so I don't think it's a server issue.

    I think the problem is that it's searching a gazillion subdirectories for additional .htaccess files. Ideally I'd move the htaccess stuff to the virtual hosts file and AllowOverride none, but unfortunately that's not an option, so I guess I'm stuck with it. But at least I know what's causing it.


Advertisement