For cases like site https://online-timer.ru with high frequency untranslatable changes translator work useless.
It not require real translate request and this case must be optimize to economy traffic, requests number and performance.
Concept
Skip translate a language independent chars for simple cases.
Detect language independent chars in text, search in translator cache a translates with original text which match with current request, but with ignore this chars on their positions and while match return translated text from this cache with replacing chars to actual.
Example:
Text in cache: Article number 1, posted in 2021 year.
Current request: Article number 523, posted in 7925 year.
Text pattern: ^Article number (\d+), posted in (\d+) year.
Notes
To do it perform, we may use temporary registry with data signature like this
type HotTextSignature = {
pattern: RegExp;
text: string;
translate: string;
replacements: Record<string, string>;
}
And keep it short time (few seconds/minutes) after last use.