wiki:rfc/jlocale-storage is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Efficient storage for jLocale


For the moment (Jelix 1.3) jLocale read properties file and store a PHP array in a cache file, to improve performance when retrieving a string. However, there can be calls to many properties files, so there are many includes. This is not still very good in term of performance and it can take many memory.


Instead of caching properties in a PHP file, use a database (NoSQL through jKvDB ?).

jLocale:get should then:

  • first, try if the given key does not exist in the database
  • if not, read the corresponding properties file, store all values in the database, and if the key does not exist: exception.

An other solution, with better performances at runtime: after the configuration compilation, jLocale reads all properties file of all modules and store values in the database. jLocale::get is then very simple. For development environment, database should be reset at each action, to take care about changes in properties file.

Corresponding ticket : 813


Last modified 9 years ago Last modified on Jan 11, 2012, 1:26:19 PM