It is quite common to change CDN from Akamai or Rackspace Cloud Files to others like KeyCDN. W3 Total Cache Plugin Possibly Gives Trouble With Updating New CDN URL.Here is How to Fix CDN Not Working Issue With WordPress W3TC Plugin. Problems which users complained so far are :
- W3TC and self hosted CDN not changing to new CDN’s URL and continuing to link to old URL of CDN
- W3TC and self hosted CDN not working with Retina.js
- W3TC and self hosted CDN breaking CSS
WordPress W3TC Plugin : Debugging Before Applying Fix For CDN Not Working Issue
Debugging needed more for checking for any gross issue, mainly for security.
We are using WordPress top of Deb GNU/Linux like Debian, Ubuntu with Nginx PHP5-FPM and Percona MySQL. This was the guide which basically suggested to use by WordPress dot ORG.WordPress W3TC Plugin is powerful and quite bulky plugin. Try unchecking all the settings for auto prime cache and increase the garbage collection intervals. Also manually deleting the content from cron entry in the
wp_options table which will force WordPress rebuild it. WP Control is a plugin which will give an idea about what is happening with cron.You need to do SSH to the server after disabling WordPress W3TC Plugin’s database cache. First, make sure that your MySQL database is not corrupted, if you have doubt about MySQL database then read this guide to repair database. Also you can fully separate the database in this way and work in kind of dev mode.
Second, try recursive deletion of the domain named directory at
wp-content/cache/page_enhanced. There may be ownership, permission related matters.
Third, fixing wp-cron.php?doing_wp_cron is important. WP-CRON is known to fail for a variety of reasons, including but not limited to conflict of plugins, DNS-related issues, WordPress bugs, Use of caching plugins. WP-CRON has dedicated page on WordPress dot ORG. Our rule of thumb is :
- Set a real Cron (shown in above linked guide)
- Disable WP-CRON via
wp-config.phpwhen you are not working on website
- Comment out to enable WP-CRON via
wp-config.phpwhen you are working on website
- Again, enable WP-CRON via
wp-config.phpwhen you are going off from your website
Odd, not much logical but the above method solves many unforeseen problems. Basically keeping WP-CRON active when you do not have the shell in front of your nose, is risky. Nginx PHP5-FPM may return errors. That is why this “BISEXUAL” way. Also, check the PHP-FPM log for error.
WordPress W3TC Plugin : Applying Fix For CDN Not Working Issue
If no fault found, yet W3TC Plugin not working rightly for CDN, do not use W3TC Plugin’s CDN function at all. Disable it. Download CDN Linker Plugin by W-Mark Kubacki from GitHub. Use Origin Pull CDN and work. After activating, setting rightly do a recursive deletion of the domain named directory at
wp-content/cache/page_enhanced. Check via webpagetest.