Understanding Page Caching

Page caching is a technique of speeding up your load times. In addition, it will reduce the processing load on your server, as well as help with your search engine rankings. Below are the different kinds of caching and how you can apply this technique to your blog or website:

Caching and Types of Caching

Caching is the act of taking repetitive PHP code and turning it into HTML so that it doesn’t have to be run through the server every time to display the same kind of page. Let’s say you run a website that uses PHP code to determine what your viewer’s IP address is and then show that back to them.

Every time someone loads your web page, the page would first determine the viewer’s PHP, turn it into HTML code, and then display that code to the user. If you cach the page the first time around, however, it will simply save that HTML so that it doesn’t have to execute the PHP command again the second time around.

In more complex web apps, as well as WordPress blogs which run on a lot of complex PHP, the speed difference and server load difference between cached and non-cached pages can be very significant.

There are three main types of caching:

1. Output caching – This is where the entire page is cached and turned from PHP to HTML.

2. Fragment caching – This is where only a portion of the page is cached. Generally this technique is used by more tech-savvy designers who want to cache just specific processing-intensive parts of a website.

3. Data caching – This is where certain data, such as comments, are cached instead of pulling it from the server every time the page is visited.

Caching Tools and Applications

If you are running a WordPress blog, you will have a lot of tools available to you for caching and speeding up your pages. Two of the most popular plug-ins are WP Super Cache and Quick Cache.

WP Super Cache is a plug-in that will take the majority of your dynamic pages and turn them into static HTML pages. It will then bypass your PHP server completely and just serve up HTML whenever it can. Although users probably won’t notice a difference right away, it can make a huge difference during peak times or if you are on a shared server.

Quick Cache is similar to WP Super Cache. Quick Cache has a complex “decision engine” (computer brain) that decides when it should and shouldn’t serve up a cached page. Anytime someone needs up-to-date data, Quick Cache will know and serve up PHP. On the other hand, anytime someone just needs a normal page, it will display the page from the cache instead.

Setting up caching on a non-WordPress website requires a decent level of PHP proficiency. Perhaps the easiest tool to set up caching on a non-WordPress platform is the Alternative PHP Cache (APC). APC is a code framework that allows developers to specify which part(s) of their website they want to cache and write their own caching code.

You now know what caching is, along with a few popular tools for setting up caching on your own website. If you are using a processing-heavy website set-up that often outputs static pages, then you could speed up your website a lot by using caching.

Share