[wp-trac] [WordPress Trac] #56051: load_textdomain() cached for the better boot-up performance
WordPress Trac
noreply at wordpress.org
Thu Aug 4 19:34:36 UTC 2022
#56051: load_textdomain() cached for the better boot-up performance
---------------------------+------------------------------
Reporter: itmapl | Owner: adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.1
Component: I18N | Version: trunk
Severity: normal | Resolution:
Keywords: needs-refresh | Focuses: performance
---------------------------+------------------------------
Comment (by itmapl):
> If I understand this correctly, the goal is to have to load and process
the language files >once, so a persistent cache makes sense. I'm not sure
how large the data is and if maybe using >the core Transient API would be
better here? Ideally using an existing caching API is >preferable over
writing files directly which might not work as expected.
Definitely correct, and yes Transient API fits much better in that case.
Here https://github.com/itma/WordPress/commits/l10n-caching-transient-api
/wp-includes/l10n.php I've been working on the ticket, and made a first
step porting the code into Transient API.
> Caches would also need to get updated on core, plugin and theme updates
where strings could >potentially change. If core doesn't already have a
"languages_updated" action maybe consider >adding one.
Good catch, I will follow that.
> I feel like the caching itself belongs in core if possible! Once we have
that, For hooks, I >definitely see value in a hook for "languages updated"
and a way for developers to disable the >caching entirely for their use
case
Definitely good idea! Will follow that.
> It would be nice to add basic profiling information to the ticket with
some before/after
> numbers for page load time and memory consumption so that we can proceed
with a better
> understanding of the implications of the change. Let me know if you want
some help with that!
Sure, numbers are always welcomed. At the end I will prepare a little sum
up. For now I need nothing from you, just have to take hands dirty, and
dive into that ticket ;-)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56051#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list