Website Construction
how to increase website speed
Submitted by balancedune, 02-05-2018, 05:01 PM, Thread ID: 86926
Thread Closed
RE: how to increase website speed
19-03-2019, 10:40 AM
#20 There are many things that can slow down your website, so there is no one right answer. Therefore, this may not be a quick fix, but rather take time to test and figure out what is causing the issue.
I recommend starting with Google Chrome's developer tools, this can show you how long it takes to connect to your server, the server to serve the page, and the resources (fonts, scripts, stylesheets, images, etc.) to load. Using some of this information could help you narrow down the problem for your website being slow. But again, this could show you that there is multiple issues with your website that could be causing slowdown. It's also worth noting, that if you are on shared web hosting or for some reason your web host is located in a different country than your primary audience, that this will majorly impact load times. If you're on shared web hosting, it could just be it's a slow server that limits connection speed to reduce server stress, all the server resources could be occupied by other websites on the same hosting provider, or it could just be a poor performance server. Shared web hosting could cause any number of these and is not recommended if you want a "fast" website.
If Google Chrome says that it is connecting to your website server quickly, then the issue is not with your hosting, but probably rather your actual web application or general page resources. If this sounds more like the problem with your website, there are a lot of things you can do to help this.
The first thing I recommend is making sure that you're not loading a bunch of large images or videos on your website, as these are typically the most time consuming. If your website is composed of a lot of images, try to compress them and make them smaller in size. Another big thing that could help is only loading the resources you need. For example, don't load fonts, scripts, stylesheets, etc. on pages that don't use them. That's taking time to load unnecessary data that you don't even use. Also, don't use excessive amounts of these either, it's not necessary. You don't need a dozen fonts on your website, as it will look disgusting and really hurt load times. Any stylesheets and scripts that you can load via CDN, do it. Things like jQuery, Bootstrap, and all the other common frameworks do have dedicated CDNs to load them from which will be faster than your website. Similar to images, try to compress your stylesheets and scripts, but before publishing them into production, test that they don't cause weird side effects after being minified. Simply removing excess spaces, tabs, and empty lines can save you some time in loading them if not fully minifying them. One more note, if your scripts are located in your head tag, move any that you can to the bottom of your page just before the closing body tag. This will give your website a chance to serve the actual page before applying all the fancy functionality.
However, if it isn't taking very long to load the resources or connect to your server, then it's your web application/host. Your host may not have a very good server, which will cause slower execution times. If you're familiar with coding, it's really simple to implement an execution timer which will time your web application from start to finish. If that is the issue, then you have a whole new journey in front of you. This could be poorly optimized code, unnecessary classes, functions, files, or plugins causing delays... or again, your web hosting provider's server could be junk and can't keep up. But in reality, assuming your using PHP, it shouldn't take more than a second or two to finish executing your script. But if it is, make sure your only loading in classes, functions, and files necessary to get your page displayed. This can easily be achieved with an Autoloader so that only when something is called to, is it loaded. Caching can help, especially if you have time consuming tasks (like rendering templates, constantly compiling data, etc.) If you're not doing anything like that, then you probably don't need a cache as that will create a time consuming task to cache things that could be loaded normally faster. If you coded your own web application, look into alternate ways that could be faster to achieve the same thing. (The easiest way to explain this to someone who knows codes in PHP, using strpos() is faster than strstr() to determine if a string occurs within another. Excessive use of this can result in major time differences.)
Lastly, while I'm not 100% sure of this, I've heard a staggering amount of people saying using cloud services (such as CloudFlare) can help your website, but some of this will also cause an intermediate loading page which can be slower than just executing your page normally. But I believe services such as CloudFlare will cache URLs to make transitioning from one page to another potentially faster, and that data would be stored on their server, not yours... which means even if your website is slow, they can display it faster than your website could. Plus many of these services offer security services as well.
If after all this, you're still struggling, I recommend bringing in a professional who can help you get your website load times to be faster, but that could cost you a lot so start with these tips and the things other people have posted to get you on your way.
I recommend starting with Google Chrome's developer tools, this can show you how long it takes to connect to your server, the server to serve the page, and the resources (fonts, scripts, stylesheets, images, etc.) to load. Using some of this information could help you narrow down the problem for your website being slow. But again, this could show you that there is multiple issues with your website that could be causing slowdown. It's also worth noting, that if you are on shared web hosting or for some reason your web host is located in a different country than your primary audience, that this will majorly impact load times. If you're on shared web hosting, it could just be it's a slow server that limits connection speed to reduce server stress, all the server resources could be occupied by other websites on the same hosting provider, or it could just be a poor performance server. Shared web hosting could cause any number of these and is not recommended if you want a "fast" website.
If Google Chrome says that it is connecting to your website server quickly, then the issue is not with your hosting, but probably rather your actual web application or general page resources. If this sounds more like the problem with your website, there are a lot of things you can do to help this.
The first thing I recommend is making sure that you're not loading a bunch of large images or videos on your website, as these are typically the most time consuming. If your website is composed of a lot of images, try to compress them and make them smaller in size. Another big thing that could help is only loading the resources you need. For example, don't load fonts, scripts, stylesheets, etc. on pages that don't use them. That's taking time to load unnecessary data that you don't even use. Also, don't use excessive amounts of these either, it's not necessary. You don't need a dozen fonts on your website, as it will look disgusting and really hurt load times. Any stylesheets and scripts that you can load via CDN, do it. Things like jQuery, Bootstrap, and all the other common frameworks do have dedicated CDNs to load them from which will be faster than your website. Similar to images, try to compress your stylesheets and scripts, but before publishing them into production, test that they don't cause weird side effects after being minified. Simply removing excess spaces, tabs, and empty lines can save you some time in loading them if not fully minifying them. One more note, if your scripts are located in your head tag, move any that you can to the bottom of your page just before the closing body tag. This will give your website a chance to serve the actual page before applying all the fancy functionality.
However, if it isn't taking very long to load the resources or connect to your server, then it's your web application/host. Your host may not have a very good server, which will cause slower execution times. If you're familiar with coding, it's really simple to implement an execution timer which will time your web application from start to finish. If that is the issue, then you have a whole new journey in front of you. This could be poorly optimized code, unnecessary classes, functions, files, or plugins causing delays... or again, your web hosting provider's server could be junk and can't keep up. But in reality, assuming your using PHP, it shouldn't take more than a second or two to finish executing your script. But if it is, make sure your only loading in classes, functions, and files necessary to get your page displayed. This can easily be achieved with an Autoloader so that only when something is called to, is it loaded. Caching can help, especially if you have time consuming tasks (like rendering templates, constantly compiling data, etc.) If you're not doing anything like that, then you probably don't need a cache as that will create a time consuming task to cache things that could be loaded normally faster. If you coded your own web application, look into alternate ways that could be faster to achieve the same thing. (The easiest way to explain this to someone who knows codes in PHP, using strpos() is faster than strstr() to determine if a string occurs within another. Excessive use of this can result in major time differences.)
Lastly, while I'm not 100% sure of this, I've heard a staggering amount of people saying using cloud services (such as CloudFlare) can help your website, but some of this will also cause an intermediate loading page which can be slower than just executing your page normally. But I believe services such as CloudFlare will cache URLs to make transitioning from one page to another potentially faster, and that data would be stored on their server, not yours... which means even if your website is slow, they can display it faster than your website could. Plus many of these services offer security services as well.
If after all this, you're still struggling, I recommend bringing in a professional who can help you get your website load times to be faster, but that could cost you a lot so start with these tips and the things other people have posted to get you on your way.
Users browsing this thread: 2 Guest(s)