跳到内容

Cached l10n

v0.2.2

lavoiesl · 2013年4月23日 上架

Caches the global variable $l10n, which stores all translations for considerable speed improvement.

正在使用
10+
评分
5.0 / 5
累计下载
2,430
最近更新
2013年4月23日
3 条评价需要 WordPress 3.0.1+已测试到 3.5.2

贡献者

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%)

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums