2016-10-25
Speeding up apache by not resolving for access
I was testing something on my own webserver and noticed the loading time of the page was over 10 seconds. Browsing the log showed me the hostname of the client was logged which was not what I wanted, and the IPv4 address I had at that moment was slow to resolve. It turned out this was caused because the part I was visiting has an authentication check, which looked like:<Location /> Order deny,allow Deny from all Allow from localhost AuthName "Restricted access" AuthType basic AuthUserFile /... AuthGroupFile /dev/null Require valid-user Satisfy Any </Location>Using the name 'localhost' triggered the resolver. A big speedup was caused by changing to:<Location /> Order deny,allow Deny from all Allow from 127.0.0.1 AuthName "Restricted access" AuthType basic AuthUserFile /... AuthGroupFile /dev/null Require valid-user Satisfy Any </Location>Which let me concentrate on other methods to speed up the site.