InMotion Hosting Support Center

If you use a database for your website, reducing the database calls your site makes can help speed things up.

Storing data inside a database makes it easier to retrieve, and makes your website more flexible. This convenience can also sometimes cause your website to take up more server resources and cause your site to load slower.

Use a cache to cut down on database calls

Most websites these days run on a CMS or Content Management system. These all rely on a database back-end to store your website content, and you can speed them all up by implementing caching.

If one visitor requests a page, your CMS will use a database call to pull in that info. You can cache this info to a file, so that the next visitor won't have to wait for the server to ask the database for that same information again.

We have guides covering some of the most common CMS applications out there:

Limiting database calls without a CMS

If you aren't using a CMS with a cache plugin to automatically reduce database calls, you'll need to do this manually. Depending on how you've coded the site this can differ a lot.

When coding your site think about how frequently database information might change. If you had a page called specials.php that pulled in monthly specials from a database. That info might only change once a month if that.

You could go ahead and update your database with the specials, then run your specials.php script once. After that just use (Ctrl-U) in your web-browser to view the HTML of that generated page.

Copy all the HTML into a new file called specials.htm. Then just link from your website to that static HTML page instead of the database driven PHP one.

Additional help for reducing database calls

There is a lot of great content on the web for how you can reduce database calls. If the information above doesn't help you out, please comment below and ask for help and we'd be glad to update this guide with more!

Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!