symfony icon indicating copy to clipboard operation
symfony copied to clipboard

[Translation] What about putting translations in a cache pool?

Open lyrixx opened this issue 8 months ago • 7 comments

It's common to update translation in production (with a cron). But then it comes to cache invalidation.

There is some hacky stuff in https://github.com/php-translation/symfony-bundle:

  • https://github.com/php-translation/symfony-bundle/blob/master/Command/DownloadCommand.php
  • https://github.com/php-translation/symfony-bundle/blob/master/Service/CacheClearer.php

If we put the translation cache into a cache pool, it will become much easier to clear the cache, and them warm it up?

WDYT?

lyrixx avatar Oct 26 '23 13:10 lyrixx

We could but I suppose this should be optional so that we keep stellar perf by default for "static" needs?

nicolas-grekas avatar Oct 27 '23 08:10 nicolas-grekas

The creator of the cache component told me the cache component is extremely fast. Maybe you know him 🙃 ; With the PHP Array apdater, the overhead is really low, isn't?

I said that, because it's boring to maintenant 2 things that does the same

lyrixx avatar Oct 27 '23 10:10 lyrixx

Let's do a small bench to help decide :)

nicolas-grekas avatar Oct 27 '23 12:10 nicolas-grekas

@lyrixx the usage of the cache component would still require rebuilding Catalogue objects. The existing cache dumps files that return them, where we get OPCache to help caching things. So this really needs a benchmark.

stof avatar Oct 27 '23 13:10 stof

There might be something to do, DX-side, to induce people defining (and restricting) the locale(s) they use/need in their apps... woulnd't that already divide by 10 the cost of locales / translatations ?

smnandre avatar Oct 28 '23 22:10 smnandre

Thank you for this suggestion. There has not been a lot of activity here for a while. Would you still like to see this feature?

carsonbot avatar Apr 29 '24 13:04 carsonbot

I think so

lyrixx avatar May 03 '24 08:05 lyrixx