Title: Cached l10n
Author: lavoiesl
Published: <strong>2013 年 4 月 23 日</strong>
Last modified: 2013 年 4 月 23 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

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

# Cached l10n

 作者：[lavoiesl](https://profiles.wordpress.org/lavoiesl/)

[下载](https://downloads.wordpress.org/plugin/cached-l10n.0.2.2.zip)

 * [详情](https://cn.wordpress.org/plugins/cached-l10n/#description)
 * [评价](https://cn.wordpress.org/plugins/cached-l10n/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/cached-l10n/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/cached-l10n/#developers)

 [支持](https://wordpress.org/support/plugin/cached-l10n/)

## 描述

Upon inspection using xhProf, I realized that the PHP implementation loading the
MO files is really slow.
 From my tests, about 25% to 40% of the time WordPress 
spends rendering the page is actually spent locating, parsing and merging all the
translation files.

This plugin works by caching the whole $l10n variable holding all the text domains
and overridding the `load_textdomain`.

Caching is done using serialize and written to `wp-content/uploads/l10n.pson`.
 
Be sure to regenerate the cache if a .mo changes.

#### TODO

 * Provide a better UI page

### Speed comparison

Comparing WordPress Gettext loading vs this plugin.

Using the average response time of:
 siege -c 1 -r 100 -b http://localhost/

Vanilla: Fresh install of WordPress
 Common: WPML, Types, Views, and Gravity Forms
Total Cache: Common + Total Cache (APC object/database cache, no page cache) BuddyPress:
BP-Registration-Options, BP Show Friends, BuddyPress, BuddyPress Activity Plus, 
Gravity Forms, Invite Anyone, U BuddyPress Forum Attachment, U BuddyPress Forum 
Editor, User Switching

    ```
                Vanilla         Common          Total Cache     BuddyPress
    Native      202 ms          565 ms          478 ms          567 ms
    Cached      193 ms (-5%)    322 ms (-43%)   333 ms (-30%)   431 ms (-24%)
    ```

## 安装

wp-content/uploads/l10n.pson must be writable

 1. Activate plugin
 2. Go to plugin’s settings page
 3. Hit the regenerate button
 4. `WP_DEBUG` must be false

## 评价

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

### 󠀁[The idea is good!](https://wordpress.org/support/topic/the-idea-is-good-2/)󠁿

 [lars Portman](https://profiles.wordpress.org/webppower/) 2020 年 6 月 22 日

hope update it someday! because basic idea is good for performance website.

 [ 阅读所有3条评价 ](https://wordpress.org/support/plugin/cached-l10n/reviews/)

## 贡献者及开发者

「Cached l10n」是开源软件。 以下人员对此插件做出了贡献。

贡献者

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

[帮助将「Cached l10n」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/cached-l10n)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/cached-l10n/)，查看[SVN仓库](https://plugins.svn.wordpress.org/cached-l10n/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/cached-l10n/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/cached-l10n/)。

## 更新日志

#### 0.2.2

 * Refactored code
 * Fixed small issues

#### 0.2

 * Refactored code
 * Added some detection when translations change

#### 0.1

 * Orignal submission

## 额外信息

 *  版本 **0.2.2**
 *  最后更新：**13 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.0.1 或更高版本 **
 *  已测试的最高版本为 **3.5.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/cached-l10n/)
 *  [高级视图](https://cn.wordpress.org/plugins/cached-l10n/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  3 条 5 星评价     ](https://wordpress.org/support/plugin/cached-l10n/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/cached-l10n/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/cached-l10n/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/cached-l10n/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/cached-l10n/reviews/?filter=1)

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

[查看全部评论](https://wordpress.org/support/plugin/cached-l10n/reviews/)

## 贡献者

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

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/cached-l10n/)