3

I'm quite new to running a website, and I've recently run my page through some page load time measurements to try and reduce load time. After scaling down my images etc, I find that the bottleneck comes from 'wait' time, notably time spent waiting for a redirect from my www domain to the domain without www.

Is there a way to prevent the additional load time caused by the redirect, while still having my page be accessible with or without the www in the URL?

I am running on a Wordpress installation on DreamHost.

http://tools.pingdom.com/fpt/#!/cmbT5V/http://www.kiwifoodie.co.nz

This question is about why the wait times are slow when loading page, but it does not address redirects.

  • Most users are not going to encounter that slowness. Once they are one your site, the links don't include the www. Search engines and other sites would generally link to the version without the www. Only type in traffic that includes the www would have that problem. Is it really a problem that needs to be solved? – Stephen Ostermiller Nov 12 '14 at 9:51
  • How are you hosting it on Dreamhost? Are you using the "one click installs"? If you do so, they put your site on a server that only serves WordPress sites and is optimized for it. I have a site set up that way and the www to no-www redirect takes only 0.195s where your www to no-www redirect takes 1.628s. – Stephen Ostermiller Nov 12 '14 at 9:54
  • 1
    Thanks for the reply, Stephen. I am hosting it using the one click install, yep. So you think the redirect is unlikely to be an issue and it just seems like that 'on paper' (ie in the test pages)? Hope this question isn't too off topic but, does my site seem to load very slowly to you? Or is it about average? – misaochan Nov 12 '14 at 9:58
  • Its worth testing without the www in the URL because most users are not going to be using your site that way. Dreamhost is not known for its performance. If you want a fast website, don't use Dreamhost. I host some things there because they are cheap and I've had an account for about 10 years now, but my money making sites that need to be fast are hosted elsewhere. – Stephen Ostermiller Nov 12 '14 at 10:02
  • 1
    Interesting note, thanks. I was using DreamHost's redirect option. I should be looking at handling it via code in .htaccess instead, then? – misaochan Nov 12 '14 at 10:36
1

If you wish to speed up the redirect, instead of using DreamHost for your DNS services and adding a site redirect in DreamHost, you might manage your DNS through your domain name registrar (Aust Domains), whose services if you're lucky may use anycast DNS and perform much faster. You would then setup the HTTP redirect in their control panel.

enter image description here

Pricing for shared web hosting is always dependent on requirements - for example, the amount of diskspace required, bandwidth required. Since in reality, you get what you pay for, if you are looking for unlimited diskspace and unlimited bandwidth but also a premium level of performance this will not come cheap however if you work out what you actually need in terms of diskspace and bandwidth and then shop around you might find a premium performance hosting solution that fits your requirements without the high price.

Alternatively Pay-As-You-Go cloud hosting solutions such as Amazon S3, Microsoft Azure, Google Cloud etc., can offer high performance for low budget if your diskspace and bandwidth requirements are not excessive.

You could also use a CDN/acceleration service such as CloudFlare to improve your DNS, redirects and site performance.

| improve this answer | |
  • Thank you! What do you think about using Google App Engine within the free quota? I'm not sure how to estimate how much bandwidth and diskspace I will need though. Will have to look that up. I get on average only about 20 (human) views per day. With the pay-as-you-go model is there a possibility that I will receive a huge charge if traffic surges or there is an attack, or lots of bot access? – misaochan Nov 12 '14 at 13:15
  • Google App Engine allows you to set a maximum daily budget, some other cloud services allow you to set a monthly cap on spending. Provided you set this you should be safe from unexpectedly high bills following a traffic spike, though at the cost of your services being replaced with an over-quota error message until the next day. Some services allow you to configure rate-limiting which if well configured can be more effective at limiting cost while ensuring a consistent level of service for genuine users before and after a traffic spike. – richhallstoke Nov 12 '14 at 15:11
  • For reference, I've just tested the Enom (Domain Name Registrar)'s URL-Redirect configured alongside DNS host records, vs DreamHost's redirect and the results for me are: Enom 331ms, DreamHost 435ms - however this will obviously vary based on physical distances, virtual infrastructure and network traffic at the time etc so it is of cause possible the results could be the other way around if I try later tonight. Typically though since the web servers at my registrar are only doing redirects I would expect them to respond quicker. – richhallstoke Nov 13 '14 at 12:42
0

Interesting note, thanks. I was using DreamHost's redirect option. I should be looking at handling it via code in .htaccess instead, then?

This is the difference: my site does this redirect quickly on Dreamhost and yours does not. Dreamhost has a setting for this that makes it work quickly. It can be set outside of wordpress using the Dreamhost panel:

To get this:

  1. Log into https://panel.dreamhost.com/
  2. Click on "Manage domains"
  3. Click the "Edit" button next to your fully hosted domain
| improve this answer | |
  • Thanks, Stephen! I have put the change in and the DH control panel says it is pending, will test the speed out again once it goes through. Purely out of curiosity... why would removing the www work faster than the other two options? – misaochan Nov 13 '14 at 0:14
  • 1
    In reality, all these redirect solutions will be using the same method of a web-server returning an HTTP 301 Redirect header with a URL, so whether this is done yourself via .htaccess, or done by Dreamhost using a .htaccess rule (this is how they outwork the options you choose in the DreamHost Panel), or done using a lighter web server than Apache doesn't really make much difference, the key is all about how high specification the instrastructure and network speeds are where this happens. I suggested moving the DNS as then you'll see increase in speed on A record lookups too at no extra cost. – richhallstoke Nov 13 '14 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.