Many people consider static variables in web applications evil because they are in global scope and break OOP principles. Others use them deliberately to get (often questionable) performance gains in web applications.
Have in mind that by using static variables you trade time
performance for space
, since your variables will allocate a constant amount of memory even if never utilized/accessed.
A fact is that you will get some response time gains, and also save some Garbage Collector work by using them.
Using static string variables might not be the best approach in terms of maintainability/flexibility. If your primary goal is to simplify maintenance using Resx resource files
is probably a safer approach, and reads will use constant time since it uses thread-safe static properties which read cached values.
However, you should always be cautious when using static variables in a web app, so I will conclude my post with the wise words of Scott Hanselman:
When using ASP.NET think twice, then think again, before throwing that static (or Shared) keyword in there. Perhaps there is a scope better suited for what you're trying to do.