Elektrine lite

← Feed

@Two9A@hachyderm.io

Post #1136488

2026-04-12 10:50 UTC

So that's interesting: Mastodon's "Translate post" feature doesn't cache the translation result, so if you want to switch back and forth it makes fresh requests to DeepL each time. Wonder how much of a pain it'd be to cache that clientside? Unless it's already cached serverside, and /translate only calls out to DeepL if it hasn't already done so for this status?

Replies (1)

  • @Two9A@hachyderm.io 2026-04-12 10:58

    Ok, not a deep mystery: the Mastodon backend does use the Rails cache (which I presume is in-memory, not persistent) to hold onto the result for up to 24 hours: https://github.com/mastodon/mastodon/blob/main/app/services/translate_status_service.rb#L18 Still involves network traffic clientside, but it's not like that feature hammers a remote service.

    Open ##1374148