i18next: Add expirationTime option to cache.

This ensures that we don't fill up local storage with cached
translations data when using a server that restarts often (e.g. a
development environment).

Fixes: #4443.
This commit is contained in:
Umair Khan
2017-04-12 10:44:30 +05:00
committed by Tim Abbott
parent 0cd7c400e1
commit 24295e6ac8

View File

@@ -20,6 +20,7 @@
var cacheOptions = { var cacheOptions = {
enabled: true, enabled: true,
prefix: 'i18next:' + page_params.server_generation + ':', prefix: 'i18next:' + page_params.server_generation + ':',
expirationTime: 2*7*24*60*60*1000, // 2 weeks
}; };
i18n.use(XHR) i18n.use(XHR)