开发者

MultiLanguage Web App and Data Caching From a Table

开发者 https://www.devze.com 2023-02-11 23:40 出处:网络
We are developing a multi-language web application with ASP.NET MVC 2 and Fluent NHibernate. Our platform will be multi-language. But just static text will b开发者_JAVA技巧e multi-language. Groups pag

We are developing a multi-language web application with ASP.NET MVC 2 and Fluent NHibernate. Our platform will be multi-language. But just static text will b开发者_JAVA技巧e multi-language. Groups pages depends on community content whatever they use. Like Facebook.

We decide to keep all language string in database. And load language when application starts.

Is this the best practice ? What is the best practice for this situation? How can I cache these text?


If you are not changing the strings with the application running, just keep them in a static dictionary.

Otherwise, read http://www.nhforge.org/doc/nh/en/index.html#performance-cache through http://www.nhforge.org/doc/nh/en/index.html#performance-querycache


I implement a database based language feature. Three tables.

  • Language
  • Language Raw Text
  • Language Translated Text

and also implemented a php like code based solution for get and setting text.

For expanded php example for my implementation click here.

0

精彩评论

暂无评论...
验证码 换一张
取 消