[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
Wed Aug 16 21:55:38 UTC 2023


#58919: Add a hook to set_cached_mo_files() to allow flexible caching strategies
for globbing *.mo files
-------------------------+-----------------------------
 Reporter:  mreishus     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  I18N         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+-----------------------------

Comment (by mreishus):

 Thanks for the feedback. I've given it another shot with covering both
 functions, built in caching and invalidation. And sorry for the delay as
 I'm not too used to working on core.

 My uncertainties are:
 - How to organize the built-in caching: Where the functions should be
 added, where the add_filter and add_actions calls are, and what the
 functions are named.
 - The invalidation strategy - I store a list of paths in another cache
 key, so we can retrieve them later when invalidating. Is there a better
 way to do this?
 - The invalidation strategy - I do it on all upgrader_process_complete
 events without checking the parameters. It seems safest and there
 shouldn't be much of a downside since I assume these events don't happen
 too often.
 - Persistent cache presence - Should the entire thing be turned off if no
 persistent object cache exists? And is this detectable?

 Thanks again for taking a look.

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


More information about the wp-trac mailing list