symfony
symfony copied to clipboard
[Translation] What about putting translations in a cache pool?
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?
We could but I suppose this should be optional so that we keep stellar perf by default for "static" needs?
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
Let's do a small bench to help decide :)
@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.
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 ?
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?
I think so