Linux 软件免费装
Banner图

{eac}ObjectCache - a persistent object cache using SQLite & APCu to cache WordPress objects.

开发者 kevinburkholder
更新时间 2025年10月25日 21:38
捐献地址: 去捐款
PHP版本: 8.1 及以上
WordPress版本: 6.8
版权: GPLv3 or later
版权网址: 版权信息

标签

performance object cache APCu sqlite wp cache {eac}Doojigger persistent object cache

下载

1.3.4 2.1.1 2.1.0 1.0.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.0.4 1.1.0 1.2.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.2

详情介绍:

The {eac}ObjectCache is a light-weight and very efficient drop-in persistent object cache that uses a fast SQLite database and even faster APCu shared memory to cache WordPress objects. See The WordPress Object Cache
The WordPress Object Cache is used to save on trips to the database. The Object Cache stores all of the cache data to memory and makes the cache contents available by using a key, which is used to name and later retrieve the cache contents. By default, the object cache is non-persistent. This means that data stored in the cache resides in memory only and only for the duration of the request. Cached data will not be stored persistently across page loads unless you install a persistent caching plugin.
Here, an object is any piece of data - a number, text, a set of database records, an API response, etc. - that can be referenced by a name or key. Objects are categorized by a group name. Groups help identify what an object is and how it is used. {eac}ObjectCache replaces the default WordPress object cache to not only store data in process memory but to also store data persistently, across requests, in APCu shared memory and/or in a SQLite database, increasing the likelihood of cache hits and decreasing the need for costly computations, complex MySQL database queries, and remote API requests. SQLite is a fast, small, single-file relational database engine. By using SQLite to store objects, {eac}ObjectCache is able to manage a relatively large amount of data (groups, keys, and values) in a very efficient and fast data-store. APCu is a shared, in-memory, persistent cache available only when the APCu PECL Extension is installed. {eac}ObjectCache uses APCu as an intermediate cache between the L1 memory cache and the L2 SQLite database cache providing extremely fast object retrieval, {eac}ObjectCache always uses per-request, in-memory caching and may operate with either APCu memory caching or SQLite database caching - or both. APCu memory caching uses a single block of memory shared by all PHP requests and is persistent until and unless the cache is cleared or the server is rebooted (or PHP restarted). SQLite database caching is persistent until and unless the cache is deliberately cleared. Features While {eac}ObjectCache does support multiple WordPress installations on a single server it does not support multiple servers per installation. SQLite and APCu work only on a single server, not in a clustered or load-balanced environment. Configuration Alternatives Assuming you have SQLite and APCu installed, what are your best options?
  1. Fastest Caching - Uses in-process memory and APCu shared memory.
  2. Disable SQLite. *
  3. define( 'EAC_OBJECT_CACHE_USE_DB', false );
  4. Advantage
  5. Fast memory-only access.
  6. Handles concurrent updates through APCu cache.
  7. Disadvantage
  8. APCu may invalidate data under memory constraint.
  9. APCu cache is not shared with CLI.
  10. APCu cache is lost on system or PHP restart.
  11. Less memory (almost as fast) - Uses in-process memory and APCu shared memory.
  12. Disable SQLite. *
  13. define( 'EAC_OBJECT_CACHE_USE_DB', false );
  14. Optimize memory use. *
  15. define( 'EAC_OBJECT_CACHE_OPTIMIZE_MEMORY', true );
  16. Advantage
  17. Fast memory-only access.
  18. Handles concurrent updates through APCu cache.
  19. Conserves per-request memory by not pushing APCu hits to in-process memory.
  20. Disadvantage
  21. Slightly slower to access APCu memory over in-process memory.
  22. APCu may invalidate data under memory constraint.
  23. APCu cache is not shared with CLI.
  24. APCu cache is lost on system or PHP restart.
  25. Most resilient (and still fast) - Uses in-process memory, APCu shared memory, and SQLite database.
  26. Do nothing, this is the default.
  27. Advantage
  28. Most cache hits will come from in-process and APCu memory.
  29. SQLite retains cache data after restart.
  30. Disadvantage
  31. Must keep SQLite database (on disk) updated.
  32. Potential concurrency issues on high-volume site.
  33. Resilient, efficient, and fast (recommended) - Uses in-process memory, APCu shared memory, and SQLite database.
  34. Optimize memory use. *
  35. define( 'EAC_OBJECT_CACHE_OPTIMIZE_MEMORY', true );
  36. Advantage
  37. Most cache hits will come from in-process and APCu memory.
  38. Handles concurrent updates better through APCu cache.
  39. Conserves per-request memory by not pushing APCu hits to in-process memory.
  40. SQLite retains cache data after restart.
  41. Disadvantage
  42. Slightly slower to access APCu memory over in-process memory.
  43. Must keep SQLite database (on disk) updated.
  44. Least efficient (default when APCu is not installed) - Uses in-process memory and SQLite database.
  45. Disable APCu. *
  46. define( 'EAC_OBJECT_CACHE_USE_APCU', false );
  47. Advantage
  48. Saves resources by not taking up APCu reserves.
  49. More secure by not using shared memory.
  50. SQLite retains cache data after restart.
  51. Disadvantage
  52. All cached data initially read from disk.
  53. Must keep SQLite database (on disk) updated.
  54. Potential concurrency issues on high-volume site.
  55. For high-volume sites - reduces or eliminates potential race conditions
  56. Optimize memory use. *
  57. define( 'EAC_OBJECT_CACHE_OPTIMIZE_MEMORY', true );
  58. Disable delayed writes. *
  59. define( 'EAC_OBJECT_CACHE_DELAYED_WRITES', false );
  60. Disable use of alloptions array.
  61. define( 'EAC_OBJECT_CACHE_DISABLE_ALLOPTIONS', true );
  62. Advantage
  63. Most cache hits will come from in-process and APCu memory.
  64. Conserves per-request memory by not pushing APCu hits to in-process memory.
  65. Updates SQLite data immediately.
  66. Conserves per-request memory by elimination large alloptions array(s).
  67. Disadvantage
  68. Slightly slower to access APCu memory over in-process memory.
  69. Multiple single-row SQLite update transactions.
  70. Slightly slower to access individual options from cache rather than alloptions array.
* These options may be set from the {eac}Doojigger administration screen. When using SQLite, delayed writes (see below) dramatically improves efficiency by only writing updates at the end of the script process. When using APCu shared memory, data is accessable by other PHP processes that may run on the server. Inside The Numbers | Label         | Value | | :---------------- | :------------------ | | cache hits | The total number of requests that returned a cached value. | | cache misses | The total number of requests that did not return a cached value. This number includes L1 cache (-), L2 non-persistent, L2 APCu (-), and L2 SQL misses. | | L1 cache hits | The number of requests that were found in the L1 memory cache. | | L1 cache (+) | Request found in the L1 memory cache with data (positive hits). | | L1 cache (-) | Request found in the L1 memory cache with no data (negative hits). | | L1 cache misses | The number of requests not found in the L1 memory cache. | | L2 non-persistent | L1 cache misses in a non-persistent group (not in L2 cache). | | L2 APCu hits | The number of L1 cache misses (minus L2 non-persistent) that were found in the L2 APCu cache. | | L2 APCu (+) | Request found in the L2 APCu cache with data (positive hits). | | L2 APCu (-) | Request found in the L2 APCu cache with no data (negative hits). | | L2 APCu misses | The number of requests not found in the L2 APCu cache. | | L2 SQL hits | The number of L2 APCu misses (or L1 cache misses) that were found in the L2 SQLite cache. | | L2 SQL misses | The number of requests not found in the L2 SQLite cache. | | L2 APCu updates | The number of APCu keys updated. | | L2 APCu deletes | The number of APCu keys deleted. | | L2 SQL selects | The number of SQLite select statements executed. | | L2 SQL updates | The number of SQLite records updated. | | L2 SQL deletes | The number of SQLite records deleted. | | L2 SQL commits | The number of SQLite transactions executed to update and delete records. | Object cache statistics may be found:

安装:

{eac}ObjectCache is an extension plugin to and is fully functional with installation and registration of {eac}Doojigger. However, the core object-cache.php file may be installed without {eac}Doojigger (referred to as 'detached' mode). In detached mode, the plugin will attempt to copy the object-cache.php file to the /wp-content folder on activation, or you may manually copy the object-cache.php file from the plugin /src folder to the /wp-content folder to activate. Options can then be set using the documented PHP constants in the wp-config.php file. Automatic Plugin Installation This plugin is available from the WordPress Plugin Repository and can be installed from the WordPress Dashboard » Plugins » Add New page. Search for 'EarthAsylum', click the plugin's [Install] button and, once installed, click [Activate]. See Managing Plugins -> Automatic Plugin Installation Upload via WordPress Dashboard Installation of this plugin can be managed from the WordPress Dashboard » Plugins » Add New page. Click the [Upload Plugin] button, then select the eacobjectcache.zip file from your computer. See Managing Plugins -> Upload via WordPress Admin Manual Plugin Installation You can install the plugin manually by extracting the eacobjectcache.zip file and uploading the 'eacobjectcache' folder to the 'wp-content/plugins' folder on your WordPress server. See Managing Plugins -> Manual Plugin Installation Settings Once installed and activated, options for this extension will show in the 'Object Cache' tab of {eac}Doojigger settings.

屏幕截图:

  • Object Cache (Advanced Options)
  • Object Cache (Cache Stats)

其他记录:

Additional Information {eac}ObjectCache is an extension plugin to and is fully functional with installation and registration of {eac}Doojigger. However, the core object-cache.php file may be installed without {eac}Doojigger - referred to as 'detached' mode. In detached mode, the plugin will attempt to copy the object-cache.php file to the /wp-content folder on activation, or you may manually copy the object-cache.php file from the plugin /src folder to the /wp-content folder to activate. Options can then be set using the documented PHP constants in the wp-config.php file. See Also {eac}KeyValue - An easy to use, efficient, key-value pair storage mechanism for WordPress that takes advatage of the WP Object Cache.

更新日志:

Version 2.1.2 – October 25, 2025 Version 2.1.1 – October 17, 2025 Version 2.1.0 – October 14, 2025 Version 2.0.0 – September 30, 2025 Version 1.4.1 – July 12, 2025 Version 1.4.0 – June 27, 2025 Version 1.3.4 – June 17, 2025 Version 1.3.3 – June 10, 2025 Version 1.3.2 – June 3, 2025 Version 1.3.1 – April 19, 2025 Version 1.3.0 - April 11, 2025 Version 1.2.2 - April 4, 2025 Version 1.2.1 - March 30, 2025 Version 1.2.0 - March 20, 2025 Version 1.1.0 - March 13, 2025 Version 1.0.4 - May 24, 2024 Version 1.0.3 - April 3, 2024 Version 1.0.2 - February 17, 2024 Version 1.0.1 - January 24, 2024 Version 1.0.0 - December 9, 2023 Version 0.5 Version 0.4 Version 0.3 Version 0.2 Version 0.1