开发者 |
greencp
underdude |
---|---|
更新时间 | 2019年12月12日 18:14 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 5.3 |
版权: | GPLv3 |
版权网址: | 版权信息 |
Any persisten object cache will do, but it has to be supported in your hosting environment. Check if any caches like APC(u), XCache, Memcache, etc. are installed on your webserver and select a suitable cache plugin respectively. File based object caches should work always and might improve performance, same goes for data base based caches. Performance gains depend on the available caching method and its configuration.
Yes
Fast Translate overrides WordPress' default implementation by using the override_load_textdomain hook. It uses a complete rewrite of WordPress' MO imlementation. The default WordPress implementaion loads a complete mo file whenever a single translation from it is needed. This needs quite some time and even more memory. Fast Translate features on demand loading. It doesn't load a mo file until the first translation call to that specific textdomain (so does WordPress since version 4.6). And it doesn't load the entire mo file either, only the requested translation. Though the (highly optimized) search for an individual translation is slower, the vastly improved loading time and reduced memory foot print result in an overall performance gain. Caching can further improve performance. When using Fast Translate with an installed and activated object cache, translations get cached using WordPress Object Cache API. Front end pages usually don't use many translations, so for all front end pages one cache is used per textdomain. Back end pages on the other hand use many translations. So back end pages get each their own individual translation cache with one base cache for each textdomain. This base cache consists of those translations that are used on all back end pages (i.e. they have been used up to admin_init hook). Later used translations are cached for each page. All this is to reduce cache size, which is very limited on many caching methods like APC. To even further reduce cache size, the transaltions get compressed before being saved to cache.