问题描述
假设我们有2个站点具有相同code myDomain.AU和myDomain.RU和本地化资源文件*的.resx和* .ru.resx。我们预计大部分英语的用户将使用非盟的网站,大部分俄罗斯用户将使用RU网站。但是,如果非盟域的一些用户会要求俄罗斯版,.RU资源将被载入AU服务器和俄语都会显示出来。
Assume that we have 2 sites myDomain.AU and myDomain.RU having the same code and localized resource files *.resx and *.ru.resx. We expected that most of English users will use AU site and most of Russian users will use RU site. However if some user of AU domain will request Russian version, .Ru resources will be loaded on AU server and Russian language will be shown.
但我不希望保留.RU资源,直到池中的回收,但要卸载他们,如果没有人使用它们。所以,我希望有缓存的本地化资源的到期时间与到期每种语言的配置的时间。
相关问题有人提出在和的
But I don’t want to keep .RU resources until recycle of the pool, but want to unload them if no one use them. So I want to have timing expiration of cached localized resources with configured time of expiration for each language.Related question was raised at http://techsoda.wordpress.com/2008/01/04/aspnet-reset-that-resource/ and http://forums.asp.net/t/1201065.aspx/1
里克·斯特劳在创建一个数据驱动的ASP.NET本地化资源提供者和编辑器(的)有
DbResourceConfiguration.ClearResourceCache(),即清除所有缓存,但不是唯一过期。
Rick Strahl in "Creating a Data Driven ASP.NET Localization Resource Provider and Editor"( http://www.west-wind.com/presentations/wwdbresourceprovider/ ) hasDbResourceConfiguration.ClearResourceCache() , that clears all cache, but not expired only.
任何建议,引用什么来实现它,欢迎的最佳方式。
Any suggestions, references what is the best way to implement it are welcome.
更新:下面里克的评论指出了我,说我做premature优化。
无论如何这将是很好知道一个解决办法,如果太多的资源加载将成为生产中的问题。
UPDATE: Rick’s comment below pointed me, that I am doing "Premature Optimization".Anyway it will be good to know a solution, if loading of too many resources will become a problem in production.
推荐答案
滑动过期开箱?
这篇关于本地化ASP.NET资源的滑动过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!