Support » Localhost Installs » Localhost wordpress using remote DB loads very slow.

  • Hello guys, i’m having this weird issue with loading times on my local installation of wordpress.

    Ideally i would like to work on my localhost but using my dev server to host the database so i can pretty much populate and use the DB while working locally.

    I achieved this by changing my wp-config file to use the remote DB and using this function to overwrite the home and siteurl:

    /* put this at the very start of get_option() in wp-includes/option.php */
    if ($option == ‘siteurl’ || $option == ‘home’) {
    $currenturi = $_SERVER[‘REQUEST_URI’];
    $mypos = strpos($currenturi, ‘/’); /* are we looking at the local site right now? */
    if ($mypos !== false)
    return ‘http://perfectworld.goat’;
    } /* continue on with normal method, if we are not looking at the local site */

    Everything is working great, BUT.

    The loading time of my localhost is like three times more than loading my internet hosted versions of the same site, it looks like connecting to the same database takes more time from my localhost than from my live url, weird uh?

    Could i get some help? It would be really awesome to be able to connect at normal speed 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • It is likely that setting things up like that creates a lot of trafic between localhost and the external server.

    The connections between the webserver and the database-server in the datacenter of your provider are many times faster than your (DSL-) connection.

    That makes sense in Aachen, thanks a lot for your answer.

    I guess there is nothing i can do in order to improve this load time right? Well, besides switching internet provider.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Localhost wordpress using remote DB loads very slow.’ is closed to new replies.