Slow web server caused by shared Hosting
$6 a month seems like a good deal for full service hosting and it is, except that you are sharing it with a whole suburb of other websites. If your neighbor on your shared hosting gets a spike in traffic, those resources are taken from your bandwidth and make your website slower. This is known as the noisy neighbor. If you get too much traffic to your website while on shared hosting, the hosting company may take your website down because it is taking too many resources from your neighbors. Being on shared hosting also limits your access to the server to only a small partition, making it impossible to configure caching software that requires access to the root of the server (more on this later).
Solution: Get on a VPS (Virtual Private Server)
Get off shared hosting by setting up a virtual private server (VPS). Having a VPS allows you full control of your technology stack, allowing you to configure your operating system, install caching software and choose Nginx as your HTTP web server server (more on caching and Nginx later).
People visiting from different parts of the world have latency from being far from your web server
Visitors from different parts of the world will have latency. If you just have one server on the west coast and someone visits from Europe, milliseconds, although not that much will be lost and the user experience affected. Delivering content quickly is part of the user experience and losing even milliseconds can drastically affect conversion rates with e-commerce and web pages with “call to actions”.
Solution: Use a CDN
Content distribution networks (CDNs), such as MaxCDN and Cloudflare, are third party services that provides servers dedicated to hosting your assets on regional servers spread across the globe. Having your assets hosted on CDNs insures that your visitors are having the best user experience possible, with the lowest amount of latency possible.
Solution: Use wp_enque inside the functions.php to load CSS and JS
With multiple concurrent visitors, Apache web server is slow
Apache HTTP web servers have been the industry standard since 1996. Concurrent connections weren’t really a problem back then since not every Tom, Dick and Harry was on the internet. Now if your website goes viral, you could have 20,000 concurrent visitors. Apache is really bad in this scenario because it creates a new process for each concurrent connection, costing valuable RAM and slowing your page load times drastically.
Solution: Use Nginx instead of Apache
NginX is 80% faster than Apache at high traffic times. Nginx has an event driven architecture that keeps a steady asynchronous connection that consumes the same amount of RAM regardless if its 2 concurrent connections or 20, 000 concurrent connections. Example, if you have 20,000 visitors to your website at one time, NginX will serve the http request with the same process through an asynchronous connection, instead of creating a new process for each visitor like Apache does.
Requesting dynamic content and assets slows down your server
Each page or post that is visited makes the server, the php on the server is then parsed, compiled and executed and sent back to the browser (or something like that). After that the assets are requested from the server and sent back to the browser. Upon each visit to a page the process repeats again, even with content that rarely changes and for all intents and purposes is static content.
Solution: Install APC cache and W3 Total Cache Plugin
If you are running on a VPS, you can install software such as APC cache and varnish HTTP accelerator. APC caches your operation code (opcode) inside your RAM instead of recompiling php on every page load. Varnish is a HTTP accelerator. APC along varnish can speed up your website by many times.
Solution #2: Use wp_cache functions
If you are experiencing issues with plugins loading multiple expensive sql queries, use wp_cache to store returned queries in a cache. Wp_cache functions require $key and $data to be passed in, $group and $expire are both optional.