Hyper Cache is a cache plugin written purely in PHP to provide with high compatibility with most WordPress setups and configurations. It can be used with low-resource hosting and well as on high-end servers alike.
This tutorial assumes you've already gone through the steps to create a StackPath CDN Site.
This article will walk you through how to perform a static assets integration, which does not support the use of the StackPath Web Application Firewall (WAF). If you’re looking to maximize security by using our CDN with the WAF, please refer to the CDN & WAF integration guide.
This walkthrough will show how to integrate and make the best use of the Hyper Cache plugin:
- Log into the WordPress admin panel.
- Hover your mouse over Plugins and click Add New.
- In the Search box, type Hyper Cache and click Search Plugins.
- Click Install Now. A prompt dialog will open and ask if you are sure you want to install the plugin. Click OK; then, after the plugin is installed, click Activate Plugin.
- Navigate to Settings → Hyper Cache.
- Navigate to the General page of Hyper Cache.
- In the Cached pages will be valid for section, you can set the amount of time you want your page to be cached. It’s set to 24 hours by default; setting it to 0 will cache it forever.
- Check Enable compression.
- Check Enable on-the-fly compression.
- Check Allow browser caching. It’s set to 24 hours by default.
- Navigate to the Mobile page.
- Under Working mode, choose cache separately if you produce different content for mobile devices. If not, select use standard cache.
- Navigate to the CDN page.
- Click Enable.
- Enter your StackPath CDN URL in the CDN URL field.
- Click on Save.
- Click on the Clean the whole cache button.
You must add to the file wp-config.php (after the define("WPLANG", "");) the line of code: define("WP_CACHE", true);
After seeing this, edit your wp-config.php file and add this in a separate line:
To ensure you implemented the StackPath CDN correctly, you can view the source code of any page to confirm that the CDN domain is being used for static assets instead of your origin domain. You can also use tools like Pingdom, Gtmetrix, Webpagetest to obtain a more detailed report on your CDN implementation status.