Free WordPress Cache Enabler Plugin
The WordPress community is very important to us here at KeyCDN, which is why we created a caching plugin called Cache Enabler. It's a lightweight caching plugin for WordPress that makes your website faster by generating static HTML files. Cache Enabler supports converting inline image URLs to WebP and pre-compressing cached pages with Gzip.
Why KeyCDN created Cache Enabler
Web performance is something we obsess over and we believe that every millisecond counts when reducing site load time. The default way of delivering a page in WordPress requires the entire WordPress core, plugins if installed, and database queries. These can be slow and consume unnecessary server resources. To fix this caching can be implemented, which is where Cache Enabler came to be. While there were several other caching plugins that existed we found that many were overly complex or cost money and we wanted something lightweight and free. This is one of the ways that we can give back to the open source community.
WordPress Cache Enabler features
The WordPress Cache Enabler plugin creates static HTML files and stores them on a server's disk. The web server then delivers the accepted static HTML file, avoiding any resource intensive backend processes. This in turn increases the speed of a WordPress site.
- Fast and efficient cache engine
- Automatic smart cache clearing
- Manual cache clearing
- WP-CLI cache clearing
- Cache expiry
- Cache size display in the WordPress dashboard
- Minification of HTML excluding or including inline CSS and JavaScript
- WordPress multisite network support
- WebP support (convert images to WebP with Optimus)
- Gzip pre-compression support
- Custom post type support
304 Not Modified
support- Works perfectly with Autoptimize and the majority of third party plugins
WebP format
To take advantage of Google's WebP format Cache Enabler allows you to serve WebP images to supported browsers. We are excited to be the very first plugin in the WordPress community to offer WebP support without the use of JavaScript. Images can be converted to WebP with our Optimus plugin. Our Optimus plugin can compress JPG and PNG images and then also convert them to WebP.
WebP is a new image format that provides lossless and lossy compression for images on the web. WebP lossless images are 26% smaller in size compared to PNGs.
Several big names are already using and experimenting with WebP, such as Facebook, Google, eBay, and Netflix. Smashing Magazine also just recently decided to implement WebP on their website. Over the last five years WebP support has significantly grown with the majority of browsers having WebP support.
JPG to WebP test
We ran a test with five large JPG images to demonstrate how much compression actually takes place and the significant size difference between .jpg
and .webp
files. We are using lossless compression with Optimus to optimize the images and also convert to WebP upon upload to the media library. Cache Enabler then delivers WebP images based on browser support.
Image | File name | Original size | Compressed JPG | WebP format | Size difference |
---|---|---|---|---|---|
jpg-to-webp-1.jpg | 480 KB | 407 KB | 43 KB | 89% | |
jpg-to-webp-2.jpg | 659 KB | 578 KB | 113 KB | 80% | |
jpg-to-webp-3.jpg | 787 KB | 715 KB | 127 KB | 82% | |
jpg-to-webp-4.jpg | 617 KB | 543 KB | 61 KB | 88% | |
jpg-to-webp-5.jpg | 605 KB | 543 KB | 70 KB | 87% |
We then ran a page comparison test with GTmetrix, JPG vs WebP, and you can see the total difference in page size. WebP resulted in a 77% decrease in page size.
Normally we recommend scaling down your images before uploading them to WordPress, but we wanted to show you as aggressive compression tests as possible.
PNG to WebP test
We then ran a test with five large PNG images to demonstrate how much compression actually takes place and the significant size difference between .png
and .webp
files. We are using lossless compression with Optimus to optimize the images and also convert to WebP upon upload to the media library. Cache Enabler then delivers WebP images based on browser support.
Image | File name | Original size | Compressed JPG | WebP format | Size difference |
---|---|---|---|---|---|
png-to-webp-1.png | 840 KB | 790 KB | 544 KB | 31% | |
png-to-webp-2.png | 903 KB | 873 KB | 638 KB | 26% | |
png-to-webp-3.png | 630 KB | 613 KB | 414 KB | 32% | |
png-to-webp-4.png | 629 KB | 606 KB | 461 KB | 23% | |
png-to-webp-5.png | 959 KB | 944 KB | 655 KB | 30% |
We then ran a page comparison test with GTmetrix, PNG vs WebP, and you can see the total difference in page size. WebP resulted in a 27% decrease in page size. These numbers correspond directly with Google's reported 26% average.
Again normally we recommend scaling down your images before uploading them to WordPress, but we wanted to show you as aggressive compression tests as possible.
Install and setup Cache Enabler
You can download Cache Enabler from the WordPress repository or install it from within your WordPress dashboard.
- In your WordPress dashboard click Plugins and then Add New.
- Search for Cache Enabler on click Install Now. After the plugin has been installed activate the plugin.
- On the left-hand side of your dashboard click Settings and then Cache Enabler.
- You can now optionally configure the following settings:
Verify cache
The WordPress Cache Enabler plugin has the ability to create multiple static HTML files for all of the enabled variants. All static HTML files can then be pre-compressed with Gzip. To verify if your pages are being cached and delivered you can simply look at the source code of your page. At the bottom, you will see an HTML comment added by Cache Enabler that contains the timestamp that the page was created and the cache variant (e.g. HTTP/HTTPS, WebP, and Gzip):
<!-- Cache Enabler by KeyCDN @ Wed, 24 Mar 2021 00:00:00 GMT (https-index-webp.html.gz) -->
Advanced features
A more advanced feature can be implemented to bypass PHP entirely by allowing the server itself to deliver the static HTML files. You can read more about this in our Cache Enabler documentation.
Clearing cache
Cache Enabler has automatic smart cache clearing, which means by default it will automatically clear pages when they are updated. However, there are multiple ways to manually clear the cache when needed:
- In the WordPress admin bar there are three possible clear cache buttons: Clear Network Cache (if in network dashboard), Clear Site Cache, and Clear Page Cache.
- From the command line with WP-CLI.
- In the settings page the "Save Changes and Clear Site Cache" button will save any changes made in addition to clearing the site cache.
Summary
Let us know what you think of Cache Enabler in the comments below. From caching to disk, pre-compression, and delivering WebP images, you can see drastic speed improvements without a complex setup. Combined with our other plugins, CDN Enabler and Optimus, we hope to further speed up your content delivery in WordPress!