Recommendation is to never get your hands dirty for such performance-oriented parts of your application unless you have a solid experience/understanding. Oh, before I start the answer, I should suggest that migrating the code to .NET Framework 4 and onwards (.NET Core and .NET Core vNext) should be the preferable route to take here. .NET Framework 3 and older systems are no longer supported and you are more likely to stumble upon such issues.
If you are interested in using the in-memory caching solution, please refer to modern caching systems such as Redis/Memcached to make the best possible use of caching resources and the system.
Redis[
^]
Note: please verify if the server/client libraries for the caching systems provide support for .NET Framework 3.5, which is
highly unlikely.
If you are still looking for something more custom, then try checking
this thread on SO[
^]; it gives an idea of how a cache system looks like. One thing to note is that caching is more than just storing, caching is about removing elements when no longer needed in the cache to maintain a manageable size, etc.