[wp-trac] [WordPress Trac] #39639: Increase cache time on wp_get_available_translations()

WordPress Trac noreply at wordpress.org
Thu Jan 19 17:36:25 UTC 2017

#39639: Increase cache time on wp_get_available_translations()
 Reporter:  leewillis77  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:

Comment (by johnjamesjacoby):

 A few observations:

 * `3 * HOUR_IN_SECONDS` is also used for getting popular tags from
 WordPress.org plugins, and for the feature list in themes
 * Feeds, cron, nonces, and plugins, themes, and core updates, all use `12
 * Auth cookies use `14 * DAY_IN_SECONDS`

 I think what's really missing here is a `_maybe_update_translations`
 function in `wp-includes/update.php`. That function/API would ideally be
 tied to the same 12 hour interval that the other file-system checks use.

 I don't think 3 hours is too long or too short, but it would be nice to be
 able to manipulate these intervals more easily, and for them to be exposed
 and used in a way that centralizes them (because right now they're
 scattered around everywhere.)

 My recommendation would be to:

 * Introduce a new `wp_get_update_interval()` function with a parameter for
 the thing being updated, and a filter at the end to allow it to be
 * Use this new function everywhere things requiring updating occur
 * Keep this function public to allow plugins to add their own update
 interval keys
 * Update the Heartbeat API to use this, too

 This way, people wanting fewer updates to wporg can more easily target
 them, and plugins wanting to play nicely can more easily do so with a
 higher rate of success and without hooking into lower-level
 options/transients APIs to do so.

Ticket URL: <https://core.trac.wordpress.org/ticket/39639#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list