Last post Jan 12, 2009 11:01 AM by hemchand
Jan 05, 2009 10:20 AM|hemchand|LINK
I have performance and code maintenance related question.
We have big application about 1000 pages in asp. We are in discussion to convert to ASP.NET. There are 25 languages to which we give support. If we maintain 25 RESX files for each ASPX page, there will be 1000*25=25000 RESX files, then is OK?
Is there any way to avoid this. Dynamic data is different. There is static text like titles, error messages, heading etc.
Will it cost performance?
localisation large application
number of pages localisation
Jan 06, 2009 10:20 PM|Nai-Dong Jin - MSFT|LINK
In your scenario, is the titles or messages on each page are different? If so, you have to generate each local resource file for each page, but if some of them are the same, you can use global resource, and in this way, it can reduce the resource file copies.
Local resource is specific to particular webpage. All the resource files related to particular webpage must be placed in a special .Net folder named App_LocalResources. This folder must be in the same folder of the webpage that you want to localize. So App_LocalResources
can be subfolder for any folder of your website.
They are the resource files for the entire web application. They are not specific to any page. They can be accessed from the entire web application. Global resource files must be located in a special .Net folder named App_GlobalResources. App_GlobalResources
must be at the root of the web application.
Jan 08, 2009 05:09 PM|hemchand|LINK
The messages are different. Yes, we can use globalisaiton, but in that case global files will grow in size, as we will be adding new messages in future.
Are resx files are cached? If yes, this will consume huge amount of server memory.
What do you think?
Jan 08, 2009 05:11 PM|hemchand|LINK
How Microsoft.com or orkut.com handle this task as they are having large number of files?
Jan 08, 2009 09:57 PM|Nai-Dong Jin - MSFT|LINK
Resources are just like config files. They dont get cached. We can compile them into the assemble if we want (the usual way). When you build your application, Visual Studio invokes the resgen.exe tool to convert your application resources into an internal
class called Resources. This class is contained in the Resources.Designer.cs file which is nested under the Resources.resx file in Solution Explorer. The
Resources class encapsulates all your project resources into static readonly get properties as a way of providing strongly-typed resources at run-time. When you build through the Visual C# IDE, all the encapsulated resource data, including both the
resources that were embedded into the .resx file and the linked files, is compiled directly into the application assembly (the .exe or .dll file).
Jan 09, 2009 09:00 AM|hemchand|LINK
You are right. But that was in ASP.NET 1.x. In ASP.NET 2.0, resx files remain as they are and not compiled in dll.
this article, he mentions that resource files are cached.
Jan 11, 2009 09:47 PM|Nai-Dong Jin - MSFT|LINK
But that was in ASP.NET 1.x. In ASP.NET 2.0, resx files remain as they are and not compiled in dll.
You may try the following article:
The article is applied for .Net 3.5 and .Net 2.0.
In the blog article you mentioned, the author is trying to achieve localization feature by creating custom resource providers which can store localization data in stores other than Resx files, so in this way caching mechanism is involved. But in this thread,
we are talking about the general way which store localization data in Resx files.
Jan 12, 2009 11:01 AM|hemchand|LINK
Still I am firm on my thoughts. There may be option whether we want to compile RESX files into dll. I created on ASP.NET WebApplication project in VS 2005 and deployed on other machine.
RESX files are in App_LocalResources folder. If I add new RESX file, it works without recompiling application.
I am not able to attach file in this Reply as the facility is not available. I will upload the project on another website and will provide the link here.