We recently worked with two clients who each had large database driven websites. And one common problem that they were facing is that they regularly exceeded the daily and monthly bandwidth allotments on their shared hosting plans. In response, one web host charged costly overage fees. The other host simply restricted access to the website for a period of up to five minutes while the server recovered. Both responses were clearly undesirable.
If you are experiencing similar problems, or have a popular website which may soon be experiencing these problems, it is a good idea to know ways to stop this from happening to you.
The most obvious method to avoid exceeding your bandwidth allotment is to reduce the server load imposed by your website. This can be done by any of the following methods, or a combination thereof:
The first two methods are fairly self-explanatory. By minimizing the size of your images, whether by resizing, cropping, or altering quality settings, this method will result in a direct decrease in bandwidth. Similarly, by removing whitespace and by simplifying the code of your dynamic files, you will also notice bandwidth savings.
However, sometimes more drastic methods need to be taken, these methods include caching and generating static files.
Caching is the storing of copies of web documents to enable quicker access to files for subsequent use. And believe it or not, your website already takes advantage of some caches.
The type of caching which is already in use are user agent caches, which are found in visitor web browsers. When users visit your website, for example, certain portions such as images, style sheets, and external JavaScript files are cached. This means that a repeat visitor does not download the complete web page, but only pieces of the page which haven’t been cached. So this does save quite a bit of bandwidth.
Additionally, you can also control which files are cached, as well as how long they should be cached. If you have large files that never change — such as JavaScript libraries or sitewide CSS files — these would be good candidates for long term caching.
Still, if your website is large, frequently accessed, and database driven, it might be necessary to resort to other, more aggressive methods to reduce bandwidth.
While databases are very fast, accessing them and processing the response requires significantly more server resources than serving a simple HTML web page. And as a website’s database gets larger, more and more resources are consumed to serve dynamic files. And this situation is only exasperated for high traffic sites, where many users may be accessing the database at the same time.
To alleviate the problem, we suggest generating static files. While generating the file will be costly, it will quickly save you on bandwidth. One added benefit is that the site will be faster for users and also reduce server load. Of course, there are a few potential drawbacks to using static files. These include the delay that users will experiencing before accessing updated content, as well as the added development time or money required to set up such a solution.
If you are interested in generating static files, you do not have to apply this to your entire site. If you have pages that are not updated daily, then these are great candidates. When these pages do change, you can set up your system to enable new pages to be created (overwriting the old pages), or you can simply set pages to update at scheduled intervals.
Whichever method you choose to minimize your bandwidth usage, you will notice some great benefits. First, and most important, you will likely be able to stay well within the bandwidth allotment of your hosting plan. This will save you from costly hosting surcharges and prevent those pesky overage messages from appearing. Additionally, your website will be faster for its visitors.
Tags: bandwidth, cache, databases, downtime, image optimization, load timeContact us today for a quote. Click here to submit details regarding your project.
If you are making a general inquiry, send an email to info@velvetblues.com