Improved phpWebsite speed with cache_page module
After using the the cache_page module for over a week on the City of Rolfe website, I new it was faster, but hadn’t done suitable testing to find out how much faster. When I finally took the time for testing, I was quite pleased with the result. Under normal server load, pages served from cache averaged 5 to 6.5 times faster than phpWebsite dynamically generated pages. Under a heavy server load, I expect the cached pages to be in the neighborhood of 10 to 20 times faster than phpWebsite dynamic pages.
Details of my testing
Sampled url: http://rolfeiowa.com/ This page includes an announcement, mini calendar + coming soon list, pagemaster page, and a menu.
Using cache_page reported times:
These times were gathered by adding a meaningless query string to the end of the test url such as http://rolfeiowa.com/?t=1. Since cached pages are keyed from the request_uri, the page is dynamically generated again by phpWebsite, giving a new dynamic page generation time. Refreshing the same url gives a time for serving the page from cache. This process was repeated with 15 different query strings and the times reported by cache_page, in the comments at the end of the html page, were recorded and averaged.
Dynamic: 3.577087 seconds/request
Cached: 0.672140 seconds/request
Cached is an average of 5.32 times faster than phpWebsite dynamically served pages.
Using a simple perl script:
These times were gathered using a simple perl script that sequentially generated 25 requests to the same url, (http://rolfeiowa.com). The total time was measured using the Time::HiRes library and then divided by the total number of requests to get the average time. cache_page was uninstalled for the dynamic test. The cache was empty at the beginning of the cached test, so the cached sample includes one dynamic page generation.
Dynamic: 25 requests, Total Time 237.77 seconds, Average time 9.5108 seconds.
Cached: 25 requests, Total Time 36.09 seconds, Average time 1.4436 seconds.
Cached is an average of 6.59 times faster than phpWebsite dynamically served pages.
11/9/05
Updated release available Cache Page phpWebSite module 0.0.3