How do I capture server side output for caching?

Started by chinmay.sahoo, 07-21-2016, 05:54:53

Previous topic - Next topic

chinmay.sahooTopic starter

It's time to look at how we can reduce server side delay by caching output. The general approach begins by rendering the page as normal, performing database queries and so on with PHP. However, before sending it to the browser, we capture and store the finished page somewhere, for instance, in a file. The next time the page is requested, the PHP script first checks to see whether a cached version of the page exists. If it does, the script sends the cached version straight to the browser, avoiding the delay involved in rebuilding the page.