I have a web site using apache httpd as the server and mysql as the backend. It publishes a ‘thought for the day’ that has gotten so popular that the server is crashing due to the number of requests. Since the same page is been requested (the thought only changes once a day), is it possible to put a caching server in front of my main server, so that when the same request is made by different clients, the caching server returns the page without having to go to the database?
Share
For slow changing pages, a cache will definitely reduce CPU usage; but in your extreme case, where the page changes once a day, and it’s perfectly predictable, it would be far easier to use a simple and fast static file server (lighthttp, nginx, etc) and a cron job to change your ‘thought of the day’ every night.
In fact, a lot of non-interactive web pages can be done this way: periodically rebuild html files from database or any other source, and use simple, fast static web servers.