I have set up a local server using 'Uniform Server Z'. It suits my needs better than WAMP and XAMPP.
I am very happy with it apart from 1 thing - it's very slow. It takes over 2 seconds between request and download for any of my webpages.
I realised if I use "127.0.0.1" to connect to my mysql database (using PDO) it's much quicker (request time from ~2s to <5ms)
I can't work out why it's taking so long to resolve 'localhost'. If I ping 'localhost' it takes <1ms. I assume there must be a setting in Uniform Server Z that is different to that of WAMP and XAMPP.
- I've tried 'HostnameLookups Off' in httpd.conf and 'skip-name-resolve' in my.ini.
- I've tried reverting my hosts file back to just simply 127.0.0.1 localhost.
- I've tried removing all instances of VirtualHosts in the apache confs.
- I don't use .htaccess.
- If I use 127.0.0.1 in my web address bar in Chrome I get the same results.
Nothing I've tried has worked.
I know the obvious answer is replace 'localhost' with '127.0.0.1' but there are 3rd party php scripts used by my site that refer to 'localhost' and some that refer to '127.0.0.1'. I'd prefer to leave them as they are.
Can anyone think of any other settings that might resolve the issue?