I don't see a problem with using Session
state or something more global like Application
state or Cache
. All you're doing is caching a value from the service. This is "optional state". Your code will still work even if you don't find the values you were saving in Cache
.
When they say "stateless", this isn't what they mean. They mean that, for instance, the behavior of your controller methods should not depend on previous calls to the controller method. Everything the controller needs to operate should be passed to it on every request, perhaps in ViewBag
.
BTW, the web was "stateless" before ASP.NET MVC. It's just that web forms allow you to write code that behaves as though the controls had state, when they really did not.