WordPress is an amazing tool for publishing a website tied into a relational database. In order to make a WordPress website perform as fast as possible Pressable uses a number of cache types. Understanding how Pressable accelerates your website with caching will help you design better websites that perform the best for your users.
Caching
Every time a visitor lands on your WordPress website, WordPress has to fetch information from your MySQL database. If you have a lot of functionality and assets on your website, that’s a lot of information to fetch, so your load time increases.
At Pressable there are a few types of caching occurring: page caching (Batcache, advanced-cache.php/object-cache.php, via Memcached), database query caching (object-cache.php, via Memcachd), OPCache (PHP Code), and static asset caching (CDN).
Page and Query Caching
Both page caching and database query caching use WordPress’ Object Cache. This class of functions allows developers to manage caching of their sites. Page caching is handled by batcache, while object caching is handled by memcached.
Page and Database query caching are always on at Pressable. However you can exclude certain pages from page/batcache by following this article.
When page and static asset caching is implemented, a static version of the website is stored and served up to visitors. This means that everything is ready to go. You can make changes to your content, and a new version will be stored when the next visitor lands on your website. In terms of performance, caching is one of the most important tools in your armory.
Static Asset Caching (CDN)
Once you place your site into Production mode your website’s assets are offloaded to a Content Delivery Network(CDN) for static asset caching. The Pressable CDN is a distributed network of servers is used solely for the delivery of assets. Assets include images and graphics, JavaScripts, downloadable files and software. Whenever a visitor lands on your website, the CDN delivers the content from the server that is closest to the visitor. This makes content delivery faster, as well as strengthening your website against surges in traffic.
If you make an update to any of the static assets (images and graphics, JavaScripts, downloadable files and software) that a CDN caches you need to purge the CDN. Click here to learn how to purge the Pressable CDN.
Learn more about how a CDN works here: Check out our guide.
OPCache (PHP Code)
Since PHP version 5.5 OPCache has been available for storing a precompiled script bytecode in the memory. This reduces server load in subsequent calls for a PHP file by having it ready to go as soon as it is called.