Title: Memcached Object Cache
Author: Mark Jaquith
Published: <strong>19 ديسمبر، 2005</strong>
Last modified: 8 نوفمبر، 2022

---

البحث عن الإضافات

هذه الإضافة **لم يتم تحديثها وتجربتها لأكثر من 3 إصدارات ووردبريس رئيسية**. قد لا
تكون خاضعة للصيانة أو تقدم الدعم والمساعدة بالوقت الحالي وقد تكون بها مشاكل في التوافق
عند إستخدامها مع إصدارات حديثة من ووردبريس.

![](https://s.w.org/plugins/geopattern-icon/memcached.svg)

# Memcached Object Cache

 بواسطة [Mark Jaquith](https://profiles.wordpress.org/markjaquith/)

[تنزيل](https://downloads.wordpress.org/plugin/memcached.4.0.0.zip)

 * [تفاصيل](https://ar.wordpress.org/plugins/memcached/#description)
 * [المراجعات](https://ar.wordpress.org/plugins/memcached/#reviews)
 *  [التنصيب](https://ar.wordpress.org/plugins/memcached/#installation)
 * [التطوير](https://ar.wordpress.org/plugins/memcached/#developers)

 [الدعم](https://wordpress.org/support/plugin/memcached/)

## الوصف

Memcached Object Cache provides a persistent backend for the WordPress object cache.
A memcached server and the PECL memcache extension are required.

## التنصيب

 1. Install [memcached](http://danga.com/memcached) on at least one server. Note the
    connection info. The default is `127.0.0.1:11211`.
 2. Install the [PECL memcache extension](http://pecl.php.net/package/memcache)
 3. Copy object-cache.php to wp-content
 4. Add the `WP_CACHE_KEY_SALT` constant to the `wp-config.php`:
 5. `php
     define( 'WP_CACHE_KEY_SALT', '...long random string...' );

This helps prevent cache pollution when multiplte WordPress installs are using the
same Memcached server. The value must be unique for each WordPress install.

## الأسئلة المتكررّة

### How can I manually specify the memcached server(s)?

Add something similar to the following to wp-config.php above `/* That's all, stop
editing! Happy blogging. */`:

    ```
    $memcached_servers = array(
        'default' => array(
            '10.10.10.20:11211',
            '10.10.10.30:11211'
        )
    );
    ```

The top level array keys, are cache groups, where ‘default’ corresponds to any cache
group that is not explicitly defined. This allows for specifying memcached servers
that only handle certain cache groups. The most common use is only specifying ‘default’.

Possible cache groups are:

    ```
    {$taxonomy}_relationships
    {$meta_type}_meta
    {$taxonomy}_relationships
    blog-details
    blog-id-cache
    blog-lookup
    bookmark
    calendar
    category
    comment
    counts
    general
    global-posts
    options
    plugins
    post_ancestors
    post_meta
    posts
    rss
    site-lookup
    site-options
    site-transient
    terms
    themes
    timeinfo
    transient
    user_meta
    useremail
    userlogins
    usermeta
    users
    userslugs
    widget
    ```

## المراجعات

![](https://secure.gravatar.com/avatar/9610e77b9c1acfe8436ce0afe252d9536b6b4b4f23aa97a10ebc24cba9bbd76f?
s=60&d=retro&r=g)

### 󠀁[Amazing performance improvement!](https://wordpress.org/support/topic/amazing-performance-improvement/)󠁿

 [rambillo](https://profiles.wordpress.org/rambillo/) 21 أكتوبر، 2023

Install is not like other plugins — and in fact if you do upload it to plugins and
then activate it, it’ll bring your site down in many cases. You can upload it (but
don’t activate!) and then use the server side to move the plugin file manually into
wp-content (and then delete the uploaded plugin folder and readme.txt). But that’s
not enough to make the whole thing work! You also need memcached running on your
server and properly configured, and the pecl memcache extension compiled on the 
server side in your php configuration, too. Make sure to use a unique salt as well.
Once it’s all there, the speed improvement is significant! Happy to try and help
those that respond to this thread if you need — or at least try to get you pointed
in the right direction. Thanks for the plugin, devs! Appreciate as you update and
keep current as well!

![](https://secure.gravatar.com/avatar/a15ec539baae35aa862ff604b11ba327a6a990d0ff7372d55314217f7099ab5f?
s=60&d=retro&r=g)

### 󠀁[Can t install the plugin](https://wordpress.org/support/topic/can-t-install-the-plugin/)󠁿

 [kalagan80](https://profiles.wordpress.org/kalagan80/) 4 سبتمبر، 2023

Unable to install the plugin : application not recognized.

![](https://secure.gravatar.com/avatar/fb5ab2d835f31b7bac4b4df4d061d4bf782071e55329e792b2e0ef25c61da290?
s=60&d=retro&r=g)

### 󠀁[Cannot redeclare wp_cache_add](https://wordpress.org/support/topic/cannot-redeclare-wp_cache_add-4/)󠁿

 [terrykernan](https://profiles.wordpress.org/terrykernan/) 17 مايو، 2023 1 reply

Tip for others here, if you are getting this error: “Cannot redeclare wp_cache_add”
It probably means you have the object-cache.php file in the wrong directory, it 
should not be in the plugins/memcached/ folder, it should be moved to the wp-content
folder!

![](https://secure.gravatar.com/avatar/374ea40afb714496967ecdd047f26a4c48c9b2b6acac65646e08bf27b7ad8806?
s=60&d=retro&r=g)

### 󠀁[FATAL ERROR PHP](https://wordpress.org/support/topic/fatal-error-php-9/)󠁿

 [legarsfred](https://profiles.wordpress.org/legarsfred/) 5 أبريل، 2023 1 reply

Fatal error: Cannot redeclare wp_cache_add() (previously declared in /htdocs/wp-
includes/cache.php:41) in /htdocs/wp-content/plugins/memcached/object-cache.php 
on line 19

![](https://secure.gravatar.com/avatar/93083231f4567aaebde042533a0a3b62f0a7da89cf857125fa58a5c7f71f665d?
s=60&d=retro&r=g)

### 󠀁[Works great!](https://wordpress.org/support/topic/works-great-8687/)󠁿

 [Miguel](https://profiles.wordpress.org/miguelgilmartinez/) 16 فبراير، 2023

It works well even with WPRocket Cache plugin. If you get fatal errors don’t forget
to install PECL memcache module to PHP.

![](https://secure.gravatar.com/avatar/2525672f136bff92260533e5d4658c745e53d7bbab383c1e5ca8f7b744c43638?
s=60&d=retro&r=g)

### 󠀁[Fatal error](https://wordpress.org/support/topic/fatal-error-4358/)󠁿

 [Alex Volkov](https://profiles.wordpress.org/vol4ikman/) 3 فبراير، 2023 2 replies

Fatal error: Cannot redeclare wp_cache_add() (previously declared in /home/accessib/
public_html/wp-includes/cache.php:41) in /public_html/wp-content/plugins/memcached/
object-cache.php on line 19

 [ إقرأ جميع المراجعات 30 ](https://wordpress.org/support/plugin/memcached/reviews/)

## المساهمون والمطوّرون

“Memcached Object Cache” هو برنامج مفتوح المصدر. وقد ساهم هؤلاء الأشخاص بالأسفل 
في هذه الإضافة.

المساهمون

 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)
 *   [ Ryan Boren ](https://profiles.wordpress.org/ryan/)
 *   [ Matt Martz ](https://profiles.wordpress.org/sivel/)
 *   [ Andy Skelton ](https://profiles.wordpress.org/andy/)
 *   [ Andrew Nacin ](https://profiles.wordpress.org/nacin/)
 *   [ Barry ](https://profiles.wordpress.org/barry/)
 *   [ Erick Hitter ](https://profiles.wordpress.org/ethitter/)
 *   [ nickdaugherty ](https://profiles.wordpress.org/nickdaugherty/)
 *   [ Mohammad Jangda ](https://profiles.wordpress.org/batmoo/)
 *   [ Simon Wheatley ](https://profiles.wordpress.org/simonwheatley/)
 *   [ jenkoian ](https://profiles.wordpress.org/jenkoian/)
 *   [ Boro Sitnikovski ](https://profiles.wordpress.org/bor0/)
 *   [ Andrija Vučinić ](https://profiles.wordpress.org/aidvu/)

لقد تم ترجمة ”Memcached Object Cache“ إلى 6 لغات. شكراً إلى جميع [المُترجمين](https://translate.wordpress.org/projects/wp-plugins/memcached/contributors)
لمُساهماتهم.

[ترجمة ”Memcached Object Cache“ إلى لغتك.](https://translate.wordpress.org/projects/wp-plugins/memcached)

### مُهتم بالتطوير؟

[تصفّح الشفرة](https://plugins.trac.wordpress.org/browser/memcached/)، تحقق من [مستودع SVN](https://plugins.svn.wordpress.org/memcached/)،
أو الاشتراك في [سجل التطوير](https://plugins.trac.wordpress.org/log/memcached/) 
بواسطة [RSS](https://plugins.trac.wordpress.org/log/memcached/?limit=100&mode=stop_on_copy&format=rss).

## سجل التغييرات

#### 4.0.0

 * Add preemptive filter pre_wp_cache_get
 * Add flush_number replication to prevent accidental flush due to flush_number 
   eviction, server rotation, etc.

#### 3.2.2

 * Remove filter, and base key stripping on presence of `key_salt`

#### 3.2.1

 * Fix bug allowing **slow-ops** entries to have the same key, so toggling doesn’t
   work

#### 3.2.0

 * Better stats(). Now shows cache group/individual calls with size of the payload
   and timings.
 * PHP 5.6.20 is now required
 * Fix **get_multi** to show per group calls
 * Added filter **(memcached_strip_keys)** to bypass memcached key stripping
 * Special group for **slow-ops** ( > 5ms ) with backtrace

#### 3.1.0

 * Add **wp_cache_get_multi**
 * Add support for the **$found** parameter
 * Set a variable for $max_expiration to 30 days
 * Code style changes
 * Different coloring for unknown stats group
 * Store host/port on failure_callback
 * Default stats counts

#### 3.0.2

 * Better output of HTML

#### 3.0.1

 * Fix key generation error in switch_to_blog()

#### 3.0.0

 * Flush site cache by rotating keys
 * Flush global cache when flushing main site

#### 2.0.6

 * Flush the local cache on wp_cache_flush()

#### 2.0.5

 * Fix missing global in switch_to_blog

#### 2.0.4

 * Remove deprecated constructor

#### 2.0.3

 * Support for unix sockets

#### 2.0.2

 * Break references by cloning objects
 * Keep local cache in sync with memcached when using incr and decr
 * Handle limited environments where is_multisite() is not defined
 * Fix setting and getting 0
 * PHP 5.2.4 is now required
 * Use the WP_CACHE_KEY_SALT constant if available to guarantee uniqueness of keys

## ميتا Meta

 *  Version **4.0.0**
 *  Last updated **قبل 4 سنوات**
 *  Active installations **10+**
 *  WordPress version ** 5.3 أو أعلى **
 *  Tested up to **6.1.12**
 *  PHP version ** 5.6.20 أو أعلى **
 *  Languages
 * [Chinese (China)](https://cn.wordpress.org/plugins/memcached/)، [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/memcached/)،
   [English (UK)](https://en-gb.wordpress.org/plugins/memcached/)، [English (US)](https://wordpress.org/plugins/memcached/)،
   [German](https://de.wordpress.org/plugins/memcached/)، [Polish](https://pl.wordpress.org/plugins/memcached/)،
   و [Russian](https://ru.wordpress.org/plugins/memcached/).
 *  [ترجمة إلى لغتك](https://translate.wordpress.org/projects/wp-plugins/memcached)
 * Tags
 * [cache](https://ar.wordpress.org/plugins/tags/cache/)[memcached](https://ar.wordpress.org/plugins/tags/memcached/)
 *  [عرض متقدم](https://ar.wordpress.org/plugins/memcached/advanced/)

## التقييم

 3.8 من 5 نجوم.

 *  [  18 5-star reviews     ](https://wordpress.org/support/plugin/memcached/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/memcached/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/memcached/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/memcached/reviews/?filter=2)
 *  [  8 1-star reviews     ](https://wordpress.org/support/plugin/memcached/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/memcached/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/memcached/reviews/)

## المساهمون

 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)
 *   [ Ryan Boren ](https://profiles.wordpress.org/ryan/)
 *   [ Matt Martz ](https://profiles.wordpress.org/sivel/)
 *   [ Andy Skelton ](https://profiles.wordpress.org/andy/)
 *   [ Andrew Nacin ](https://profiles.wordpress.org/nacin/)
 *   [ Barry ](https://profiles.wordpress.org/barry/)
 *   [ Erick Hitter ](https://profiles.wordpress.org/ethitter/)
 *   [ nickdaugherty ](https://profiles.wordpress.org/nickdaugherty/)
 *   [ Mohammad Jangda ](https://profiles.wordpress.org/batmoo/)
 *   [ Simon Wheatley ](https://profiles.wordpress.org/simonwheatley/)
 *   [ jenkoian ](https://profiles.wordpress.org/jenkoian/)
 *   [ Boro Sitnikovski ](https://profiles.wordpress.org/bor0/)
 *   [ Andrija Vučinić ](https://profiles.wordpress.org/aidvu/)

## الدعم

لديك شيء لتقوله؟ بحاجة الى مساعدة؟

 [عرض منتدى الدعم](https://wordpress.org/support/plugin/memcached/)