Caching
Browser caching with local storage
import i18next from "i18next";
import ChainedBackend from "i18next-chained-backend";
import HttpBackend from "i18next-http-backend";
import LocalStorageBackend from "i18next-localstorage-backend";
i18next
.use(ChainedBackend)
.init({
fallbackLng: "en",
// ... your i18next config
backend: {
backends: [
LocalStorageBackend,
HttpBackend
],
backendOptions: [{
expirationTime: 7 * 24 * 60 * 60 * 1000 // 7 days
}, {
loadPath: '/locales/{{lng}}/{{ns}}.json'
}]
}
});Server side caching with filesystem
React-native caching with AsyncStorage
Server side Next.js caching with filesystem
Last updated