Why use a cache on a database driven site?

Why use a cache on a database driven site?

Because you can get a message like this from your hosting provider when a site starts getting real traffic.

Currently your site is using too many resources on our server (MySQL queries are taking up 20%+ of CPU usage on the server). Please look into the cause of this, particularly recent code changes and updates. Thanks! P.S. Please be aware that if your site continues to overuse server resources we may be forced to suspend your account.
A cache will stop these needless database calls. If only a page or two changes on your site daily, don't make database calls every time. A cache will save the Html of the generated page for however long you specify instead of relaoding the php code. I found a lot of useful info at the link below. Read up before you get a message like this one.

PHP Tutorials

Stephan Miller

Written by

Kansas City Software Engineer and Author

Twitter | Github | LinkedIn