Making WordPress.org

Changeset 10446


Ignore:
Timestamp:
11/12/2020 06:48:44 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: i18n: Remove fulltext caching, in preference for running the translation replacement process on each request.

This seems to provide minimal benefit while increasing the amount of data pulled from the cache.
I believe it was originally for performance, but basic testing doesn't seem to be greatly affected.

This brings some compatibility with translation plugins by allowing the gettext filter to run on each sub-string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php

    r10445 r10446  
    383383                }
    384384
    385                 $cache_suffix = "{$locale}:{$key}";
    386 
    387                 // Try the cache.
    388                 if ( false !== ( $cache = $this->cache_get( $slug, $branch, $cache_suffix ) ) ) {
    389                         // DEBUG
    390                         // var_dump( array( $slug, $branch, $cache_suffix, $cache ) );
    391                         return $cache;
    392                 }
    393 
    394385                $originals = $this->get_gp_originals( $slug, $branch, $key, $content );
    395386
    … …  
    423414                // Translate the marked originals.
    424415                $content = $this->translate_marked_gp_originals( $content, $translations, $originals );
    425 
    426                 $this->cache_set( $slug, $branch, $content, $cache_suffix );
    427416
    428417                return $content;
Note: See TracChangeset for help on using the changeset viewer.