Wordpress plugins
WP Super Cache

WP Super Cache

Version : 1.5.5
Tested up to : 4.8.2
Number of download : 16223396
Author : Automattic
Average rating : 4 / 5 on 1278 votes 1278 votes, 4 avg.rating

Screenshots

WP Super Cache
WP Super Cache
WP Super Cache
WP Super Cache

This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts. The static html files will be served to the vast majority of your users: Users who are not logged in. Users who have not left a comment on your blog. Or users who have not viewed a password protected post. 99% of your visitors will be served static html files. One cached file can be served thousands of times. Other visitors will be served custom cached files tailored to their visit. If they are logged in, or have left comments those details will be displayed and cached for them. The plugin serves cached files in 3 ways (ranked by speed): Expert. The fastest method is by using Apache mod_rewrite (or whatever similar module your web server supports) to serve “supercached” static html files. This completely bypasses PHP and is extremely quick. If your server is hit by a deluge of traffic it is more likely to cope as the requests are “lighter”. This does require the Apache mod_rewrite module (which is probably installed if you have custom permalinks) and a modification of your .htaccess file which is risky and may take down your site if modified incorrectly. Simple. Supercached static files can be served by PHP and this is the recommended way of using the plugin. The plugin will serve a “supercached” file if it exists and it’s almost as fast as the mod_rewrite method. It’s easier to configure as the .htaccess file doesn’t need to be changed. You still need a custom permalink. You can keep portions of your page dynamic in this caching mode. WP-Cache caching. This is mainly used to cache pages for known users, URLs with parameters and feeds. Known users are logged in users, visitors who leave comments or those who should be shown custom per-user data. It’s the most flexible caching method and slightly slower. WP-Cache caching will also cache visits by unknown users if supercaching is disabled. You can have dynamic parts to your page in this mode too. This mode is always enabled but you can disable caching for known users, URLs with parameters, or feeds separately. Set the constant “DISABLE_SUPERCACHE” to 1 in your wp-config.php if you want to only use WP-Cache caching. If you’re not comfortable with editing PHP files then use simple mode. It’s easy to set up and very fast. Recommended Settings Simple caching. Compress pages. Don’t cache pages for known users. Cache rebuild. CDN support. Extra homepage checks. Garbage collection is the act of cleaning up cache files that are out of date and stale. There’s no correct value for the expiry time but a good starting point is 1800 seconds. Consider deleting the contents of the “Rejected User Agents” text box and allow search engines to cache files for you. Likewise, preload as many posts as you can and enable “Preload Mode”. Garbage collection will still occur but it won’t affect the preloaded files. If you don’t care about sidebar widgets updating often set the preload interval to 2880 minutes (2 days) so all your posts aren’t recached very often. When the preload occurs the cache files for the post being refreshed is deleted and then regenerated. Afterwards a garbage collection of all old files is performed to clean out stale cache files. Cached files will still be deleted when posts are made or edited or comments made when preloading is enabled. See the WP Super Cache homepage for further information. Developer documentation is also available for those who need to interact with the cache or write plugins. There’s a GIT repository too if you want to contribute a patch. The commit list is a good place to start if you want to know what has changed since you last downloaded the plugin. Interested in translating WP Super Cache to your language? See the translation page for the plugin. The cache directory, usually wp-content/cache/ is only for temporary files. Do not ever put important files or symlinks to important files or directories in that directory. They will be deleted if the plugin has write access to them. How to uninstall WP Super Cache Almost all you have to do is deactivate the plugin on the plugins page. The plugin should clean up most of the files it created and modified, but it doesn’t as yet remove the mod_rewrite rules from the .htaccess file. Look for the section in that file marked by SuperCache BEGIN and END tags. The plugin doesn’t remove those because some people add the WordPress rules in that block too. To manually uninstall: Turn off caching on the plugin settings page and clear the cache. Deactivate the plugin on the plugins page. Remove the WP_CACHE define from wp-config.php. It looks like define( 'WP_CACHE', true ); Remove the Super Cache mod_rewrite rules from your .htaccess file. Remove the files wp-content/advanced-cache.php and wp-content/wp-cache-config.php Remove the directory wp-content/cache/ Remove the directory wp-super-cache from your plugins directory. If all else fails and your site is broken Remove the WP_CACHE define from wp-config.php. It looks like define( 'WP_CACHE', true ); Remove the rules (see above) that the plugin wrote to the .htaccess file in your root directory. Delete the wp-super-cache folder in the plugins folder. Optionally delete advanced-cache.php, wp-cache-config.php and the cache folder in wp-content/. Preloading You can generate cached files for the posts, categories and tags of your site by preloading. Preloading will visit each page of your site generating a cached page as it goes along, just like any other visitor to the site. Due to the sequential nature of this function, it can take some time to preload a complete site if there are many posts. To make preloading more effective it can be useful to disable garbage collection so that older cache files are not deleted. This is done by enabling “Preload Mode” in the settings. Be aware however, that pages will go out of date eventually but that updates by submitting comments or editing posts will clear portions of the cache. Garbage Collection Your cache directory fills up over time, which takes up space on your server. If space is limited or billed by capacity, or if you worry that the cached pages of your site will go stale then garbage collection has to be done. Garbage collection happens on a regular basis and deletes old files in the cache directory. On the advanced settings page you can specify: 1. Cache timeout. How long cache files are considered fresh for. After this time they are stale and can be deleted. 2. Scheduler. Setup how often garbage collection should be done. 3. Notification emails. You can be informed on garbage collection job progress. There’s no right or wrong settings for garbage collection. It depends on your own site. If your site gets regular updates, or comments then set the timeout to 1800 seconds, and set the timer to 600 seconds. If your site is mostly static you can disable garbage collection by entering 0 as the timeout, or use a really large timeout value. CDN A Content Delivery Network (CDN) is usually a network of computers situated around the world that will serve the content of your website faster by using servers close to you. Static files like images, Javascript and CSS files can be served through these networks to speed up how fast your site loads. You can also create a “poor man’s CDN” by using a sub domain of your domain to serve static files too. OSSDL CDN off-linker has been integrated into WP Super Cache to provide basic CDN support. It works by rewriting the URLs of files (excluding .php files) in wp-content and wp-includes on your server so they point at a different hostname. Many CDNs support origin pull. This means the CDN will download the file automatically from your server when it’s first requested, and will continue to serve it for a configurable length of time before downloading it again from your server. Configure this on the “CDN” tab of the plugin settings page. This is an advanced technique and requires a basic understanding of how your webserver or CDNs work. Please be sure to clear the file cache after you configure the CDN. REST API There are now REST API endpoints for accessing the settings of this plugin. You’ll need to be authenticated as an admin user with permission to view the settings page to use it. This has not been documented yet but you can find all the code that deals with this in the “rest” directory. Custom Caching It is now possible to hook into the caching process using the add_cacheaction() function. Three hooks are available: ‘wp_cache_get_cookies_values’ – modify the key used by WP Cache. ‘add_cacheaction’ – runs in phase2. Allows a plugin to add WordPress hooks. ‘cache_admin_page’ – runs in the admin page. Use it to modify that page, perhaps by adding new configuration options. There is one regular WordPress filter too. Use the “do_createsupercache” filter to customize the checks made before caching. The filter accepts one parameter. The output of WP-Cache’s wp_cache_get_cookies_values() function. See plugins/searchengine.php as an example I use for my No Adverts for Friends plugin. Updates Updates to the plugin will be posted here, to Holy Shmoly! and the WP Super Cache homepage will always link to the newest version.

Download now