Why is there such a high download amount?
Last updated
Last updated
You may notice on your invoice or in your project statistics (i.e. on your Health / Metrics page) an elevated amount of high downloads.
Due to how serverless functions work, you cannot guarantee that a cached version of your data is available. Serverless functions are short-lived, and can shut down at any time, purging any in-memory or filesystem cache. This will probably generate downloads for each serverless function invocation.
This will trigger i18next to fetch the translations again and generates new downloads on each request.
Solution: Try to redesign how the i18next initialization, to only have one i18next instance or alternatively clone the i18next instance.
Depending on your Next.js deployment environment the root cause of this will be either because it's some kind of serverless environment or because a new i18next instance is created under the hood.
Solution: Follow this guide and bundle the translations with your Next.js app or use i18next-locize-backend only on client side.
Depending on your Remix deployment environment the root cause of this will be either because it's some kind of serverless environment or because a new i18next instance is created under the hood.
Solution: Follow this guide and this example and bundle the translations with your Remix app.
Due to how mobile apps work, when fetching remote data (like your translations), they will not be cached, event if you define some caching in locize. Such a setup will probably generate downloads on each app start.
Solution: We suggest to download the translations when packaging your app (via cli or via api) and bundle them with your mobile app. Alternatively, if you still want to have some sort of "live" fallback and you're using i18next with react-native, you may want to try the alternative caching with AsyncStorage.