[wp-trac] [WordPress Trac] #58919: Add a hook to set_cached_mo_files() to allow flexible caching strategies for globbing *.mo files

WordPress Trac noreply at wordpress.org
Mon Jan 15 19:03:42 UTC 2024


#58919: Add a hook to set_cached_mo_files() to allow flexible caching strategies
for globbing *.mo files
--------------------------------------+-------------------------
 Reporter:  mreishus                  |       Owner:  swissspidy
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.5
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-------------------------
Changes (by swissspidy):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"57287" 57287]:
 {{{
 #!CommitTicketReference repository="" revision="57287"
 I18N: Cache list of language file paths in `WP_Textdomain_Registry`.

 Loading a list of language file paths using `glob()` can be expensive if
 involving thousands of files.

 Expands scope of `WP_Textdomain_Registry` to cache list of language file
 paths in object cache and provides a way to invalidate that cache upon
 translation updates. Plugins can clear the cache using calls such as
 `wp_cache_delete( 'cached_mo_files_' . md5( $path ), 'translations' );`

 Props mreishus, swissspidy
 Fixes #58919
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58919#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list