Title: WP Cache Block
Author: prettyboymp
Published: <strong>Òkúdù 13, 2010</strong>
Last modified: Èrèlé  14, 2011

---

Ṣàwárí àwọn plugin

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

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

# WP Cache Block

 Láti ọwọ́ [prettyboymp](https://profiles.wordpress.org/prettyboymp/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/wp-cache-block.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/wp-cache-block/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/wp-cache-block/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/wp-cache-block/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/wp-cache-block/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/wp-cache-block/)

## Àpèjúwe

Adds ability to globally cache certain segments of code.

WP Cache and some other caching plugins work amazingly well, however, their benefits
are limited in sites with a large percentage of logged in users. While working on
these projects, we, Voce Connect, found the need for a better caching solution. 
We needed to easily cache rendered portions of the theme that were the same for 
each user without caching other portions that may have user specific content. The
solution was to come up with a plugin that could be easily integrated into a theme
to help cache these blocks of content.

Requirements:

 * WordPress 2.8 or higher
 * “php5” Ìtumọ̀ Yorùbá: – IÌtumọ̀ Yorùbá: ’m a big proponent of dropping the php4
   compatibility of WordPress due to the improved OO support. Because of this, I
   prefer to write my plugins in php5 form in hopes to help push the community along.

## Ìgbéwọlẹ̀

 1. Upload `wp-cache-block` folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Add cache block areas to the slower parts of your theme. See below.

Adding a cache block only requires wrapping the section of content you want to cache
in a couple of lines of code. The key is make sure that the cache block is uniquely
idtentified based on the content it will render.

For simple content that is the same on every page:

    ```
    <?php if(wp_cacheblock_start('my-content')) : ?>
    //the content you want to cache
    <?php endif; wp_cacheblock_end(); ?>
    ```

Content that varies based on page, user, etc, will need to use key builders. Key
builders are simple classes that help make a unique key for the block of content
based on different parameters.

For caching the_loop in index.php youÌtumọ̀ Yorùbá: ’ll need to add a Query_Unique_Key_Builder
which creates a key based on passed in query_var keys:

    ```
    <?php $key_builders = array(new Query_Unique_Key_Builder( array ('paged') ) );
    <?php if(wp_cacheblock_start( 'index-loop', array('key_builders'=> $key_builders) ) ) : ?>
      //the post loop
    <?php endif; wp_cacheblock_end(); ?>
    ```

To cache the comment output, you can use the Pending_Comment_Unique_Key_Builder 
so users with pending comments will get their own cached page.

    ```
    <?php $key_builders = array( new Pending_Comment_Unique_Key_Builder() );
    <?php if(wp_cacheblock_start('index-loop', array('key_builders'=> $key_builders) ) ) : ?>
      //the comment loop
    <?php endif; wp_cacheblock_end(); ?>
    ```

If youÌtumọ̀ Yorùbá: ’re having to render complex data per user, the Per_User_Unique_Key_Builder
will help create a unique key per user for the content:

    ```
    <?php $key_builders = array( new Per_User_Unique_Key_Builder() );
    <?php if(wp_cacheblock_start('index-loop', array('key_builders'=> $key_builders) ) ) : ?>
      //the user specific content
    <?php endif; wp_cacheblock_end(); ?>
    ```

## FAQ

  Do I need this plugin?

Probably not. Full page rendering is the best solution for most sites. This plugin
is really only useful for sites that have a great deal of user specific content 
areas that causes full page caching to no longer be an option.

## Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

## Àwọn Olùkópa & Olùgbéejáde

“WP Cache Block” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa
sí plugin yìí.

Àwọn Olùkópa

 *   [ prettyboymp ](https://profiles.wordpress.org/prettyboymp/)

[Túmọ̀ “WP Cache Block” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/wp-cache-block)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/wp-cache-block/), ṣàyẹ̀wò
[ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/wp-cache-block/), tàbí ṣe àgbékalẹ̀
sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/wp-cache-block/)
nípasẹ̀ [RSS](https://plugins.trac.wordpress.org/log/wp-cache-block/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 0.1.1

 * Limited transient key length to 45 chars per https://core.trac.wordpress.org/
   ticket/15058
 * Fixing unique key when only a block name is provided.

#### 0.1.0

 * Initial release.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **0.1.1**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 16 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **10+**
 *  Ẹ̀yà WordPress ** 2.8 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **3.0.5**
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/wp-cache-block/)
 * Àwọn àmì
 * [cache](https://yor.wordpress.org/plugins/tags/cache/)[cache block](https://yor.wordpress.org/plugins/tags/cache-block/)
   [caching](https://yor.wordpress.org/plugins/tags/caching/)[output caching](https://yor.wordpress.org/plugins/tags/output-caching/)
   [performance](https://yor.wordpress.org/plugins/tags/performance/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/wp-cache-block/advanced/)

## Àwọn ìbò

Kò sí ìwádìí tí a tíì fi ránṣẹ́.

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

[Wo gbogbo àwọn àgbéyẹ̀wò](https://wordpress.org/support/plugin/wp-cache-block/reviews/)

## Àwọn Olùkópa

 *   [ prettyboymp ](https://profiles.wordpress.org/prettyboymp/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/wp-cache-block/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](http://voceconnect.com/)