WP Super Cache is a full page caching plugin for WordPress. When a page is cached almost all of WordPress is skipped and the page is sent to the browser with the minimum amount of code executed. This makes the page load much faster.
1.6.3 is the latest release and is mostly a bugfix release but it also adds some new features.
- Added cookie helper functions (#580)
- Added plugin helper functions (#574)
- Added actions to modify cookie and plugin lists. (#582)
- Really disable garbage collection when timeout = 0 (#571)
- Added warnings about DISABLE_WP_CRON (#575)
- Don’t clean expired cache files after preload if garbage collection is disabled (#572)
- On preload, if deleting a post don’t delete the sub directories if it’s the homepage. (#573)
- Fix generation of semaphores when using WP CLI (#576)
- Fix deleting from the admin bar (#578)
- Avoid a strpos() warning. (#579)
- Improve deleting of cache in edit/delete/publish actions (#577)
- Fixes to headers code (#496)
This release makes it much easier for plugin developers to interact with WP Super Cache. In the past a file had to be placed in the “WP Super Cache plugins directory” so that it would be loaded correctly but in this release I’ve added new actions that will allow you to load code from other directories too.
Use the wpsc_add_plugin action to add your plugin to a list loaded by WP Super Cache. Use it like this:
do_action( 'wpsc_add_plugin', WP_PLUGIN_DIR . '/wpsc.php' )
You can give it the full path, with or without ABSPATH. Use it after “init”. It only needs to be called once, but duplicates will not be stored.
In a similar fashion, use wpsc_delete_plugin to remove a plugin.
The release also makes it much simpler to modify the cookies used by WP Super Cache to identify “known users”. This is useful to identify particular types of pages such as translated pages that should only be shown to certain users. For example, visitors who have the English cookie will be shown cached pages in English. The German cookie will fetch German cached pages. The action wpsc_add_cookie makes this possible.
do_action( 'wpsc_add_cookie', 'language' );
Execute that in your plugin and WP Super Cache will watch out for the language cookie. The plugin will use the cookie name and value in determining what cached page to display. So “language = irish” will show a different page to “language = french”.
Use wpsc_delete_cookie to remove a cookie. Cache files won’t be deleted. It’s doubtful they’d be served however because of the hashed key used to name the filenames.
do_action( 'wpsc_delete_cookie', 'language' );
If you’re going to use either of the plugin or cookie actions here I recommend using Simple Caching. While the plugin will attempt to update mod_rewrite rules, it is much simpler to have PHP serve the files. Apart from that, any plugins loaded by WP Super Cache will be completely skipped if Expert mode is enabled.