# Increase WordPress performance on IIS

**Date:** 2015-04-19  
**Author:** Kees C. Bakker  
**Categories:** PHP, WordPress  
**Tags:** IIS  
**Original:** https://keestalkstech.com/increase-wordpress-performance-on-iis/

![Increase WordPress performance on IIS](https://keestalkstech.com/wp-content/uploads/2015/04/IncreaseWordPRessSpeedIIS-3.jpg)

---

I noticed that the *Time To First Byte* (TTFB) of my blog was taking way too long. First I thought it should be resolved by implementing caching. Then I noticed that it couldn't be the caching, as I kept getting a TTFB that was way off. After some research I found the reason: *IPv6!*

## Short answer

Say what!? Yep... I was surprised too. The short answer: open up your *wp-config.php* file and change the `DB_HOST` definition:

```php
/** MySQL hostname */
/** define('DB_HOST', 'localhost'); */
define('DB_HOST', '127.0.0.1');
```

## It's the driver!

The long answer: the driver that does the MySQL connection is not compatible with IPv6. When the driver is initialized, it needs to resolve the `localhost` and gets an IPv6 address. It connects, times out and decides to use the IPv4 address (`127.0.0.1`). That's why specifying the IPv4 address seriously speeds up your WordPress installation.

If your database runs on a different server, you can use [`gethostbyname`](http://php.net/manual/en/function.gethostbyname.php) to resolve the IPv4 address.

More info in this [StackOverflow thread](http://stackoverflow.com/a/23859050/201482).
