My website currently is running slow when doing certain AJAX calls. If I do the ajax action consecutively in a row, it is fine. But if I pause for a few minutes and then fire off the ajax event, the response would take a long time. The reason, according the the timeline, is DNS Lookup.
I'm currently using a DNS provider but could this also be a problem with my web app itself or Apache?
My app is running on the LAMP stack. This problem happens for different people. So it is probably not a problem with my local machine or browser.
See attached image for the timeline sample. The first post request took a long time but the subsequent ones were all below 1 second.
I recently changed my vhost settings for apache using ServerAlias in an entry. Before the ServerAlias had it's own entry as a ServerName.
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /home/staging/www ServerName mydomain.com </VirtualHost> <VirtualHost *:80> DocumentRoot /home/staging/www ServerName www.mydomain.com </VirtualHost> <VirtualHost *:80> DocumentRoot /home/staging/www ServerName test.mydomain.com </VirtualHost>
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /home/staging/www ServerName mydomain.com ServerAlias www.mydomain.com test.mydomain.com </VirtualHost>