Locale project translation static cache is not efficiently used

Created on 13 September 2022, over 2 years ago
Updated 14 February 2023, about 2 years ago

Problem/Motivation

On a site with a large number of extensions and languages the loading time of /admin/reports/status can be very high due to how extensions translations are checked, even when local files only are used.

This is mainly due to having the locale_translation_get_file_history static cache being wiped out completely on every project/language check done.

Steps to reproduce

* Create a Drupal site with a considerable amount of extensions (124 in my case)
* Enable a considerable amount of languages (59 in my case)
* Load the status page at /admin/reports/status
* Load time should be considerably high (over 1 min or fail with a 504 status in case of some proxies)

Proposed resolution

Implement the current todo note on making the static cache management more fine grained - i.e., clear only the entries needed.

Remaining tasks

Write tests
Review patch attached.

User interface changes

None.

API changes

None.

There are different issues that strive to modernize the usage of related functions and static caches - those are linked. Despite of changing those for a more modern approach they _might_ still suffer from the same inefficient cache invalidation issue.

πŸ› Bug report
Status

Needs work

Version

9.3

Component
LocaleΒ  β†’

Last updated 4 days ago

Created by

πŸ‡§πŸ‡·Brazil erickbj

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    To move forward this issue will need a test case to show the problem
    Updated issue summary for it.

Production build 0.71.5 2024