WARNING The development of WP-FFPC had been put on hold.
If you need new features, please send code and pull requests to WP FFPC @ Github.
A short why: I developed this plugin in 2010 to support my own site. Right now, as it is, it’s working on a few sites I still maintain for friends and since I don’t need any additional features, I’m not planning to extend it with things I have no real use of. During the past years I’ve received some heartwarming donations – unfortunately the amount never came close to consider the project financially beneficial. I removed the donation links and put it on hold for now.
WP-FFPC is a cache plugin for WordPress.
It works with any webserver, including, but not limited to, apache2, lighttpd, nginx.
This plugin does not kick in right after activation. You have to adjust the setting in Settings -> WP-FFPC and save the settings.*
- WordPress >= 3.0
- at least one of the following for storage backend:
- PHP 5.3+ is really highly recommended, see “Known issues”
- errors will not be displayed on the admin section if PHP < 5.3, only in the logs. This is due to the limitations of displaying the errors ( admin_notices is a hook, not a filter ) and due to the lack of proper anonymus functions in older PHP.
- If you’re using PHP 5.4+ avoid the APC backend: the plugin with that setup can even make your site slower. Please use APCu or memcached in this case.
- various backends
- cache exclude options ( home, feeds, archives, pages, singles; regex based url exclusion )
- minor Woocommerce support
- (optional) cache for logged-in users
- 404 caching
- canonical redirects caching
- Last Modified HTTP header support (for 304 responses)
- shortlink HTTP header preservation
- pingback HTTP header preservation
- talkative log for WP_DEBUG
- multiple memcached upstream support
- precache ( manually or by timed by wp-cron )
- varying expiration time for posts, taxonomies and home
- (warning: untested since WordPress 3.8) WordPress Network support
- fully supported domain/subdomain based WordPress Networks on per site setup as well
- will work in Network Enabled mode only for subdirectory based Multisites ( per site settings will not work in this case )
Many thanks for donations, contributors, supporters, testers & bug reporters:
Harold Kyle, Eric Gilette, doconeill, Mark Costlow, Jason Miller, Dave Clark, Miguel Clara, Anton Pelešev, Firas Dib, CotswoldPhoto, tamagokun, Many Ayromlou, mailgarant.nl, Christian Rößner, Ameir Abdeldayem, Alvaro Gonzalez, Meint Post, Knut Sparhell, Christian Kernbeis, Gausden Barry, Maksim Bukreyeu, Lissome Hong Kong Limited, Gabriele Lauricella, 7th Veil, LLC, Julia Harsch, Grant Berntsen, Jorgen Ilstad, Cinema Minima for Movie Makers Worldwide
- Upload contents of
- Enable WordPress cache by adding
- Activate the plugin through the
Pluginsmenu in WordPress ( site or Network wide )
- Check the settings in
Settings( site or Network Admin, depending on activation wideness ) ->
WP-FFPCmenu in WordPress.
- Save the settings. THIS STEP IS MANDATORY: without saving the settings, there will be no activated caching!
Using the plugin with NGiNX
If the storage engine is either PHP Memcache or PHP Memcached extension, the created entries can be read and served directly from NGiNX ( if it has memcache or memc extension )
A short configuration example is generated on the plugin settings page, under
NGiNX tab according to the saved settings.
NOTE: Some features ( most of additional HTTP headers for example, like pingback, shortlink, etc. ) will not be available with this solution.
- The plugin is not working!
Did you save the settings as mentioned in this document?
Do you have at lest one supported backend?
- It’s making my site slower than it was!
So far this only happened if PHP 5.4 or higher was used with APC.
Please avoid this setup; PHP 5.4 shipped opcache and APC is full of bugs since then. Use APCu with PHP 5.4+.
- Does it support mobile theme switching?
No, it doesn’t, and with the way it’s currently working, it never will.
WP-FFPC is using the URL as key for caching, so it can’t differentiate if there is no change in the URL.
(I personally also disagree with separation of mobile and non-mobile theme; you need to support a plethora of screen sizes and resolutions, so just use responsive designs instead of splitted logics.)
- Can you please add ‘(insert shiny new feature here)’?
Sure. Send me a code and a pull request on WP FFPC @ Github.
Unfortunately I don’t have the resources to code it myself, but there are plenty of WordPress developers who would probably do it for a minor fee.
Contributi e sviluppo
“WP-FFPC” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.Collaboratori
Changelog (registro delle modifiche)
Version numbering logic:
- every A. indicates BIG changes.
- every .B version indicates new features.
- every ..C indicates bugfixes for A.B version.
- annoying typos in text
- exclude cache for WooCommerce
- fix load textdomain
- add Italian (it_IT) translation
- nonexistent redis support removed (it never got to a usable stable state, mostly due to the chaos with the redis php modules)
- readme cleaned up for development hibernation
- donation link removed
- WP version compatibility bumped
- merged filter for HTML before it hits the cache
- refactored logging
- fixed nginx configuration sample snippets
- nginx configuration moved from Settings tab to Help tab, so if you’re looking for the “nginx” tab, you need to look under “Help” on the WP-FFPC Settings page.
IMPORTANT, READ THIS
- Proper browser cache support:
- new options to set real browser cache expiry for singles, taxonomy and home
- added Etag support based on browser cache expiry
- added proper Expires header according to cache entry generation time + browser cache expiry
- added support for Last Modified header for home & taxonomy ( singles already had it) based on the last post modified date within the taxonomy
- bugfix for is_writable check failures ( see: https://wordpress.org/support/topic/settings-saved-but-getting-not-saved-error-message)
- bugfix for memcached.protocol notice
- typo fixes
- replace variable with string constant in translatable messages
- adding exclude option based on text entry matching ( regex )
- changes in HTML debug comment: instead of the former, single comment, now 2 comments are added. The first is added when the cache entry is generated; the second only appears if the page was served from the cached entry. Please note that this last bit will – should – change with every single refresh.
- backend code is now split into separate files
- more debug code
- small change in key creation: prefix is kept in front of sha1 hashes for debugging purposes
- sha1 key hashing made to be optional
- added additional debug condition of WP_FFPC__DEBUG_MODE constant to be
- fixing the wrong release of 1.8.0
- backend keys are now sha1 hashes instead of full url; this is to prevent too long key error with memcached
Under the hood:
* wp-common is removed; no more git submodules
* logging method changed
- detailed log messages for other log message clarification
- added auto-upgrade for advanced-cache.php on plugin upgrade
- merged pull request for wp-ffpc-purge
- fixed alert backwards compatibility for PHP < 5.3
- anonymus function call only for PHP 5.3
- wp-ffpc was not actually alerting when it had issues; this should be fixed now
This was a really bad bug and it could have cause a lot of issues since the plugin was probably not working in some cases when the alerts went unnoticed. Due to WordPress restrictions on admin_notices hook I had to use PHP features only present since 5.3. Please keep this in mind.
- localhost cache forced exclude removed; instead please use
define('WP_CACHE', $_SERVER['REMOTE_ADDR'] !== '127.0.0.1');instead as pointed out by plescheff if required
- compatibility tested up to WordPress 4.1
- expiration time set to ‘0’ resulted instant expiration instead of infinite keep; fixed now
- merged pull request for memcached proxy compatibility; memcached binary mode if off by default from now on
- Unable to determine path from Post Permalink noise fixed
- potential Multisite precache bug fixed ( database prefixes were not set according to original prefix )
- added permanent cache exception of localhost
- pingback header preservation is now off by default and can manually be turned on
- added varying expiration time options
- dropped Xcache support: the reasons behind this is the outstandingly terrible documentation of Xcache
- dropped persistent memcache mode: no one was using it and even if the were only caused trouble
- removed ‘/wp-‘ hardcoded cache exception; this is now the default in the regex exceptions field as ^/wp-; please add this manually in case you’ve already been using the regex field
- downgraded log level from halting-level fatal to warning ( thank you PHP for the consistent naming… ) in case the selected extension is missing
- leftover code parts cleanup
- there were still some alway-on log messages
- merge pulled from plescheff
- fixed bug of alway-on log messages ( warning was set to default where notice should have been )
1.6 release, correcting SVN madness with non-recursive copies.
- added functionality to exclude regex urls, contribution from plescheff
- added functionality to include “?” containing URL
- some warning messages removed in case there’s not a single backend installed when the plugin is activated
- fixed issue of resetting settings when new version of defaults was released
Under the hood:
- major changes to the abstract wp-common class for better interoperability between my plugins
- APCu backend added ( APCu is a stripped version of APC with only user object cache functionality what can be used with PHP 5.4 & 5.5 besides Opcache )
- Xcache backend added ( theoretical, partially tested, volunteer testers required )
- invalidation for comment actions added
- removed broadcast message
- better logs ( additional logs and adding translation compatibility )
- 1.3.1 was a quickfix for an uncommitted change required for 1.3 to work.
- removed PHP warning in case WP_CACHE was off ( see https://github.com/petermolnar/wp-ffpc/issues/14 )
- PHP notices in log from Harold Kyle
- ms is really second
- uninstall will not fail anymore ( and I hate PHP for it’s retarted language restrictions )
- typo fix for memcache functions from Dave Clark
- uninstall security lines from Dave Clark
- modification to nginx sample file from Harold Kyle to skip all urls with query string present
- added unix socket memcache module support ( ONLY for memcache backend for now )
- 404 for first hit of 404 pages; bug report from [phoenix13](wordpress.org/support/profile/phoenix13 phoenix13)
- call to undefined function get_blog_option error fixed
- additional cookie patterns to exclude visitors from cache, contribution from Harold Kyle
- syslog dropped; using “regular” PHP log instead
- pre-cache from wp-cron
- changeable key scheme ( was fixed previously ); possibility to add user-specific cache if PHPESSID cookie is present
- logged in cookie check fixed ( was not checking all WordPress cookies )
- global error messages to show if settings are not saved
- there’s no info log on/off anymore, it’s triggered when WP_DEBUG is active
- sync protocols has been removed for two reasons: this has to be done by other systems and causes issues in special cases
- the abstract class have been moved into a separate Github repository, wp-common. Because PHP is not capable of replacing/redefining classes, there’s a versioning with the abstract and the utilities class, please be aware of this.
- bugfix: Memcache plugin was diplaying server status incorrectly ( although the plugin was working )
- bugfix: typo prevented log to work correctly
- HTML comment option for displaying cache info before closing “body” tag ( a.k.a make sure it works “noob” method )
- pre-cache function ( only manual pre-cache is enabled for now; uses permalinks structure )
- new, additional invalidation method: clear post & all taxonomy cache, including feeds
- full virtual server example to use the plugin with nginx ( originally it was only a snippet required to use the plugin )
- contributed fixes from Harold Kyle to surpress PHP notices and warnings; better CSS & JS enqueue; corrected admin panel descriptions
- bugfix for status check ( there were situations where the status was not updated correctly )
- manual flush cache bug fixed ( was only flushing if the settings were on “flush all” )
- bugfix on data & meta prefixes ( some places used hardcoded prefixes )
- feed caching fixed ( due to a security check it turned out feeds were excluded for a long time )
- plugin development using GitHub repository from this version
- Software licence change from GPLv2 to GPLv3
- backend code completely replaced ( object-based backend, improved readability & better structure, lot less global vars, etc. )
- added proper uninstall ( uninstall hook was not removing options from DB, uninstall.php will )
- revisited multisite support ( eliminated overwriting-problems )
- preparations for localization support ( all strings are now go through WordPress translate if available )
- more detailed log & error messages
- retouched Memcache initialization ( faster connect, cleaner persistent connections )
- proper settings migration from previous versions
- faulty expiration times fixed
- eliminated warning message for memcache when no memcache extension is present
- fixed multisite settings overwriting issue
- APC entry compression support
- refactored & corrected backend status check for memcached driver
- true WordPress Network support:
- if enabled network-wide, settings will be the same for every site
- if enabled only per site settings could vary from site to site and cache could be active or disabled on a per site basis without interfering other sites
- delete options button to help solving problems
- settings link for plugins page
- readme cleanup
- setting link URL repair & cleanup
WARNING, MAJOR CHANGES!
- default values bug ( causing %3C bug ) really fixed by the help of Mark Costlow firstname.lastname@example.org
- UI cleanup, new tabbed layout
- WP-FFPC options moved from global menu to under Settings in both Site and Network Admin interfaces
- added ‘persistent’ checkbox for memcached connections
- added support for multiple memcached servers, feature request from ivan.buttinoni ( ivanbuttinoni @ WordPress.org forum )
- case-sensitive string checks replaced with case-insensitives, contribution of Mark Costlow email@example.com
- refactored settings saving mechanism
- additional syslog informations
- additional comments on the code
- lots of minor fixes and code cleanup
- donation link on the top
- long-running %3C bug fixed by the help of Mark Costlow firstname.lastname@example.org, many thanks for it. It was cause by a bad check in the default values set-up: is_numeric applies for string numbers as well, which was unknown to me, and cause some of the values to be 0 where they should have been something different.
- added optional sync protocoll option: replace all http->https or https->http depending on request protocol
- binary mode is working correctly with memcached extension
- added warning message for memcache extension in binary mode
There are major problems with the “memcache” driver, the source is yet unkown. The situation is that there’s no response from the memcached server using this driver; please avoid using it!
- storage key extended with scheme ( http; https; etc. ), the miss caused problems when https request server CSS and JS files via http.
- tested against new WordPress versions
- added lines to “memcached” storage to be able to work with NGiNX as well
- added lines to “memcached” to use binary protocol ( tested with PHP Memcached version 2.0.1 )
- “memcache” extension fails in binary mode; the reason is under investigation
- apc_cache_info replaced with apc_sma_info, makes plugin faster
- added syslog debug messages possibility
- bugfix: removed (accidently used) short_open_tags
- NGiNX-sample.conf file added, NGiNX config is created from here
- memcache types bugfix, reported in forum, thanks!
- bugfix, duplicated inclusion could emerge, fix added, thanks for Géza Kuti for reporting!
- added APC compression option ( requires PHP ZLIB ). Useful is output pages are large. Compression is on lowest level, therefore size/CPU load is more or less optimal.
- first public release