Title: WP Fragment Cache
Author: mariuspass
Published: <strong>26 Tháng 4, 2014</strong>
Last modified: 18 Tháng 6, 2014

---

Tìm kiếm plugin

Plugin này **chưa được cập nhật với 3 phiên bản mới nhất của WordPress**. Nó có 
thể không được hỗ trợ và bảo trì, và có thể xung đột với các phiên bản WordPress
mới nhất.

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

# WP Fragment Cache

 Bởi [mariuspass](https://profiles.wordpress.org/mariuspass/)

[Tải về](https://downloads.wordpress.org/plugin/wp-fragment-cache.zip)

 * [Chi tiết](https://vi.wordpress.org/plugins/wp-fragment-cache/#description)
 * [Đánh giá](https://vi.wordpress.org/plugins/wp-fragment-cache/#reviews)
 *  [Cài đặt](https://vi.wordpress.org/plugins/wp-fragment-cache/#installation)
 * [Nhà phát triển](https://vi.wordpress.org/plugins/wp-fragment-cache/#developers)

 [Hỗ trợ](https://wordpress.org/support/plugin/wp-fragment-cache/)

## Mô tả

**This plugin requires PHP version 5.3.6 or greater and can’t be activated without
a [persistent backend](https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Cache_Plugins)
for the [WordPress Object Cache](https://codex.wordpress.org/Class_Reference/WP_Object_Cache).**

Adds ability to cache particular sections of your site. This plugin is for people
who can’t use a full page cache or for sites with lots of pages and with frequent
changes.
 It can cache entire loops with the WP_Query(bypassing the database queries)
or only the html output of the loop and if the query results has changed(comment
added, post was edited, postmeta has changed …) the cache will be invalidated and
regenerated.

### Example usage:

    ```
    <?php if ( ! WP_Fragment_Cache::output( $wp_query_or_blockname, $duration ) ): ?>

      //content to be cached

      <?php WP_Fragment_Cache::store(); ?>
    <?php endif; ?>
    ```

#### Parameters:

**$wp_query_or_blockname**
 (mixed/string) (optional) a WP_Query(WP_Comment_Query)
result or a string. Default: the file and the line where the call was initiated(
e.g. widgets/most-commented.php:18).

**$duration**
 (int/string) (optional) Defines how many seconds to keep the cache
for. If you pass 0 the cache will not expire. If you pass the string “only_today”
the cache will expire at the end of the current day. You can use [WordPress Time Constants](https://codex.wordpress.org/Transients_API#Using_Time_Constants).
Default: 86400 (one day).

### Advanced usage:

See the [wiki pages](https://github.com/mariuspass/wp-fragment-cache/wiki) on GitHub

## Cài đặt

 1. You should have a [persistent backend](https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Cache_Plugins)
    for the [WordPress Object Cache](https://codex.wordpress.org/Class_Reference/WP_Object_Cache)
    enabled. This plugin can’t be activated without a persistent cache.
 2. Download the plugin and unzip.
 3. Upload them to `/wp-content/plugins/` directory on your WordPress installation.
 4. Then activate the WP Fragment Cache plugin from Plugins page.
 5. Edit your template files to include WP Fragment Cache. See the [Description tab](https://wordpress.org/extend/plugins/wp-fragment-cache/)

## Hỏi đáp

  I can’t activate the plugin.

Please make sure that you have a [persistent backend](https://codex.wordpress.org/Class_Reference/WP_Object_Cache#Persistent_Cache_Plugins)
for the [WordPress Object Cache](https://codex.wordpress.org/Class_Reference/WP_Object_Cache)
enabled.

## Đánh giá

Không có đánh giá nào cho plugin này.

## Người đóng góp & Lập trình viên

“WP Fragment Cache” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.

Những người đóng góp

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

[Dịch “WP Fragment Cache” sang ngôn ngữ của bạn.](https://translate.wordpress.org/projects/wp-plugins/wp-fragment-cache)

### Muốn tham gia phát triển?

[Duyệt code](https://plugins.trac.wordpress.org/browser/wp-fragment-cache/), check
out [SVN repository](https://plugins.svn.wordpress.org/wp-fragment-cache/), hoặc
theo dõi [nhật ký phát triển](https://plugins.trac.wordpress.org/log/wp-fragment-cache/)
qua [RSS](https://plugins.trac.wordpress.org/log/wp-fragment-cache/?limit=100&mode=stop_on_copy&format=rss).

## Nhật ký thay đổi

#### 1.0.4

 * PHP 5.3 compatibility fix.
 * Make PHP version 5.3.6 minimal requirement.

#### 1.0.3

 * Fix example usage code block.

#### 1.0.2

 * Improve the description of the persistent cache requirement to avoid any confusion.

#### 1.0.1

 * Add README and CHANGELOG.
 * Add link for Advanced usage.

#### 1.0.0

 * Initial release.

## Meta

 *  Phiên bản **1.0.4**
 *  Cập nhật lần cuối **12 năm trước**
 *  Số lượt cài đặt **10+**
 *  Phiên bản WordPress ** 3.7.0 hoặc cao hơn **
 *  Đã kiểm tra lên đến **3.9.40**
 *  Ngôn ngữ
 * [English (US)](https://wordpress.org/plugins/wp-fragment-cache/)
 * Thẻ
 * [cache](https://vi.wordpress.org/plugins/tags/cache/)[cache block](https://vi.wordpress.org/plugins/tags/cache-block/)
   [caching](https://vi.wordpress.org/plugins/tags/caching/)[output caching](https://vi.wordpress.org/plugins/tags/output-caching/)
   [performance](https://vi.wordpress.org/plugins/tags/performance/)
 *  [Nâng cao](https://vi.wordpress.org/plugins/wp-fragment-cache/advanced/)

## Đánh giá

Chưa có đánh giá nào được gửi.

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

[Xem tất cả đánh giá](https://wordpress.org/support/plugin/wp-fragment-cache/reviews/)

## Những người đóng góp

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

## Hỗ trợ

Có điều gì muốn nói? cần giúp đỡ?

 [Xem diễn đàn hỗ trợ](https://wordpress.org/support/plugin/wp-fragment-cache/)