WP Super Cache is a web performance plugin that helps web administrators manage caching inside the WordPress CMS. It comes with a built-in feature for integrating the StackPath CDN, as well as other web performance features.
This article will walk you through the most simple Static Assets Integration. To get the most out of StackPath (WAF and DDoS protection) you will need to use a Full Site Integration
Before you begin, we highly recommend you test the performance of your site using Google Page Speed or Pingdom Tools. You can test your site now and after setting up the plugin for a before and after performance comparison.
This tutorial assumes you've already gone through the steps to create a StackPath CDN Site.
Log in to the WordPress admin panel:
On the left-hand sidebar, hover over Plugins and select Add New:
In the plugin search box, type WP Super Cache. Then press Enter on your keyboard:
The WP Super Cache plugin will appear:
Click Install Now.
After WP Super Cache is installed, select the Activate Plugin link.
On the main WordPress dashboard, hover over the Settings tab on the left sidebar and select WP Super Cache
Select the tab named Easy in the top navigation bar. Then tick the Caching On option and select Update Status:
Select the Advanced tab and configure the options to best fit your website. Here are options Stackpath recommends configuring:
Tick the box next to Cache hits to this website for quick access and the box next to Caching.
Tick the box next to Use mod_rewrite to serve cache files. This will disable the Legacy page caching box.
- Under Miscellaneous, tick boxes next to the following options:
- Compress pages so they’re served more quickly to visitors
- Don’t cache pages for known users
- Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated
The options under the Advanced tab should be configured like this:
If you need 304 caching, use the php caching method as it can’t work with mod_rewrite. Also, the php method has a performance advantage compared to legacy mode.
Click Update Status, leaving the rest of the options as is.
If a message with Update Mod_Rewrite Rules appears, scroll down the page, find the mod_rewrite option, tick the box, then update the status again.
Select the CDN tab and tick the Enable CDN Support box:
In the box next to Off-site url, enter the SCD(CDN) URL prefixed with http:// (Example: http://site-company.stackpathdns.com). If you’re using a custom CDN domain such as cdn.domain.com, enter that into the text field instead:
Enter the same CDN URL in the box next to Additional CNAMES:
Click Save Changes.
Select the Contents tab and click Delete Cache to make sure cached content is fresh.
Verify the source code of any page to confirm that the CDN domain is being used for static assets instead of your origin domain. Your CDN URL should precede directories designated for static content.
Example: something.stackpathcdn.com/images/image-1.png NOT company.com/images/image-1.png
Test Speed and SEO after Stackpath CDN is Enabled
Compare the before and after tests and note that it can take one to seven days for your site to reflect the performance improvements of a CDN. Both of these test sites also will give you SEO recommendations that you can follow.
Feel free to take a look at these articles for some possible next steps with your CDN Integration:
In the event you have problems with the integration, we have 24/7 integration assistance via live chat by clicking our chat bubble at the bottom of this page! We are always happy to help answer questions and to help make sure you experience the fastest and most secure experience with Stackpath CDN.