We previously discussed how to create the perfect MVP and choose a suitable platform for your website. Today, we explain how you can optimize and fine tune your business website to handle fast growth. No entrepreneur wants their website or mobile app to fail customers. Therefore, there are 3 things you should address to optimize performance:
- Choose the right server
- Code Optimization
- A Caching Mechanism
1. Choose the Right Server
- Shared Hosting:
Examples of a shared hosting are Bluehost, GoDaddy, and HostGator, that usually cost $10/month. A shared hosting is basically a big computer with 1000 websites sharing the same CPU and RAM. However, here’s what might happen:
- When you get more traffic, the shared hosting will notify you to upgrade your plan because you are using more than 5% of the CPU.
- They will suggest their $200/month plan that will give you a better performance.
- When you get even more traffic, they will suggest you upgrade again to dedicated servers for $500/month.
What you should know is that you can get the same performance as the one hosting companies are offering, but for $30/month instead. Our advice here is to never choose a shared hosting unless you are on a tight budget.
- VPS Hosting:
You can get a VPS hosting for $30/month from companies like FutureHosting.com. A VPS is not on a shared server. You are on your own server, through a machine that has been virtualized to be separated into different servers. Let’s say the machine has 4 CPU’s and 4 GB of RAM, and they have 4 VPS. Each user gets 1 CPU and 1 GB of RAM. This way, you can increase your resources being asked to upgrade. If anything, your website will get slower. When that happens, you will increase your resources to 4 or 8 GB of RAM, but it’s not something you want to get into. This is why:
Knownhost.com is an example of a managed VPS, which means they handle the server and all the system administration. The highest plan they offer seems like a great deal from a hardware perspective. But from a software perspective it’s not, because only 1 line of code that is not optimized can bring down your server.
For example, if you have 100 GB of storage and your developer decides to put all the images in RAM to increase performance while your server only has 12 GB of RAM, it won’t work. And if you want to get a server with 100 GB of RAM, it might cost you a thousand dollars/month.
2. Code Optimization:
- Get your developer to use the coding standards of the platform they are working with. For example, WordPress PHP coding standards advise to use single quotes if you’re not evaluating anything in the string. In that case, developers should not use double quotes because those tend to have variables inside of them and take more time to evaluate since it has to go through the server and PHP parser. Double quotes are also more taxing on the server which affects overall performance.
Another example is indentation. A code written all on one line is not readable. If you are getting another developer to check your code, they will have to refactor the code and make it look cleaner before proceeding.
- Hire a third-party developer. Let them check the quality of your code, your coding standards, code logic, and security issues. Make sure it’s a senior developer even if you’ll pay more than what you paid your initial developer. This developer would make a report and ask your initial developer to fix the issues found.
- Review your code. Every 2 to 3 months, get the same code editor to review your code and maintain a well optimized and secure code. You might encounter security holes if you don’t.
- Get your developer or server administrator to implement a caching service. Caching will help you speed up your website without increased costs. Instead of going through the server every time and sending a request to the user, we have a data storage layer in front of the server checking when the last request for that data was served. If nothing has changed in the page since, then the server serves the cached version of the data.
- Install Cloudflare. If you have a 100 MB video on your website, it takes 100 MB of your bandwidth every time someone visits your website. To avoid this, a CDN is a distributed network where these videos are hosted and served to the world depending on the closest location to users. If you’re on the East Coast in the United States, you have a CDN server in New York that serves you data. If you’re in Beirut, Lebanon, you have a CDN server in Beirut and Jordan.
- Advantages of a CDN:
- The closer the files are to you, the faster the performance.
- Cloudflare will enhance your website’s performance by 5 to 6 times.
- It will cost you $24 for the smaller plan or $200 for the enterprise plan that nobody really uses.
Visit our website www.staggeringroi.com where you will find more videos and many detailed articles. Don’t forget to subscribe to our YouTube channel as well!