| re: Cache data for a web service in HttpRuntime.CodeGenDir?
Hello Richlm,
for global data in ASP.NET webservice, there are several options for you to
persist it. For example, using disk file, using in memory cache, or using
database. If the data won't be quite large that will affect your server's
memory pressure, using in-memory cache would be most efficient. For file
based cache storage, I don't think the HttpRuntime.CodeGenDir (temporary
folder of ASP.NET) is preferred since it is mostly for internal use (such
as the assembly cache, dynamically generated code generation's cache...)
and it is not guranteed that your custom data put there won't be modified
by the internal operations of CLR runtime. IMO, you can consider put your
application's logic cache data in an application specific folder (such as a
sub directory under the App_Data dir of your ASP.NET application). How do
you think?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights. |