I spent a good deal of time over the past few nights tweaking and testing every configuration setting possible with Incapsula to eek out better caching and performance for my sites that run behind Incapsula. As you may or may not already know, Incapsula is my favorite cloud service for security your WordPress blog without having to rely on a plugin and let the potential attacks hit your web hosting provider directly. I like attacks that are stopped at the cloud and don’t even allow the resource access to your hosting provider in the first place. Because even blocked attempts can consume web hosting resources which is a good reason to consider Incapsula. Incapsula also offers better security for your site than Cloudflare and other options, just read these articles if you want to know more and see thorough analysis on how good Incapsula really is.
So once you have Incapsula setup, here are some instructions on how to maximize it’s caching performance and configure it so it doesn’t interfere with W3 Total Cache or your WordPress Administrative Dashboard when you have it’s caching setup this way.
First, log into your Incapsula account and click on the “stats” button for your site.
Then click on the settings button on the top right next to events.
Here click on the performance tab and make sure Incapsula is set to Aggressive caching mode. You can leave the default for 1 hour unless you publish more frequently than 1 hour per day, then you may want to scale this back. Remember that even new posts may not show up until cache flushes, so if you publish often you want to tailor this back to 1/2 hour or so.
Under the Incapsula settings once you have Aggressive cache setup you will have to make sure that Incapsula doens’t cache your WordPress admin or W3 Total Cache files if you are using that plugin too. To do this scroll down to where you see the “Never cache the following resources”
Set the left to say “URL contains” and set the 1st resource as /wp-admin, then click Add URL and add another URL Contains statement that says w3tc. When finished click save at the top of this page.
Finally it is time to maximize your caching and compression even before W3 Total Cache kicks in, this is like compressing and caching your site from the cloud, so that it handles caching before letting it hit your WordPress site for additional caching.
At the bottom of the Incapsula Performance Configuration I first tested with every single button off, then enabled them all 1 at a time and manually flushed cache, waiting 10 minutes between each change and testing to make sure no noticeable impact.
On the fly compression and TCP Pre-Pooling helps resources load ahead of time and pre-fetch all to save time and speed up content and site load times. Finally you can setup no-cache and max-age directives which are recommended by Google Insights and comply with User-Agent which helps make sure browser compatibility for mobile devices and other items are properly being passed and picked up.
Now, here is the thing, with a combination of W3 Total Cache tuning and Incapsula cache tuning I was able to improve my Google Pagespeed Insights score by nearly 30 points, and improve my Pingdom Tools score by 25 points. But I noticed the effects more in the browser, when testing my sites with a browser in private or incognito mode they loaded instantaneously from various tests, and using WhichLoadsFaster and comparing to some other blogs I know, my blogs that were optimized with Incapsula tuned this way outperformed many, many other sites I tested.
However, FamousBlogger.net did an AMAZING job with their pageload times, and they had the fastest pageload times of any site I have ever seen. Their pageload times were never even at 1 second, and my site was consistently 2-3 seconds.
My site tied 3 times with CopyBlogger blog
And came out mostly faster than problogger.net
So the only way to get even better performance than Incapsula and W3 Total Cache tuning would probably be to use a very lean/optimized theme and powerful web hosting, but my smaller sites are all on the Bluehost shared hosting plan, and the performance is exceptional considering.