I have an httpmodule that reads from a csv file for redirection rules.
However, since it's an httpmodule and it is checking on every request, I obviously don't want to read the file every time.
What are some strategies to cache the rules (in an in Array) so that I do not have to read the file on every request?
Update: Using .NET 2.0
On cache miss you will read your values and also transform them into a list of certain object types and cache them. The benefits:
HttpModule
Additional note
It should be noted as well that OS caches files as well. So if you frequently use certain files access will be quicker on consequent reads if they are done in a relative short time-frame. Relative because this depends on server load, memory usage etc. Just from the top of my head. But it would still be much slower than caching described.