If the data will truly never change you could also use HttpContext.Current.Application to store the information.
According to an overview here:
Application
is not a cache, its a global named value collection. if you add an object to Application
it will stay until a an appdomain recycle.
- Application variables are shared variables among all users of a web application
- Application variables behave like static variables and they are substitute of static variables as static variables are stateless in web applications
- Only shared values should be persisted in Application variables, and as soon as they are not in use they should be removed explicitly.
Cache
:It is possible to obtain significant performance improvements in ASP.NET applications by caching frequently requested objects and data in either the Application
or Cache
classes. While the Cache
class certainly offers far more flexibility and control, it only appears to offer a marginal advantage in terms of increased throughput over the Application
class for caching. It would be very difficult to develop a testing scheme that could accurately measure the potential advantages of the Cache
class's built - in management of lesser-used objects through the scavenging process as opposed to the fact that Application does not offer this feature. The developer needs to take decision in this case and should be based on the needs and convenience of the project and its usage patterns.