0

I'm trying to create an asp.net web api that calls an external api and gets a response that needs to be stored server side in session context and then later reused in further calls.

What will be best practice for this?

  • One option is to cache it https://stackoverflow.com/questions/16443795/caching-data-in-web-api – Marcus Höglund Feb 13 '18 at 14:00
  • another option is to use the api for what it's meant to be, discrete calls wit no state between the calls. How do you know there will be more calls that will need that data? You are better off caching data on your UI side than putting this burden on the api. If this is static data then use something like Redis. Maybe this would help : https://stackoverflow.com/questions/16443795/caching-data-in-web-api – Andrei Dragotoniu Feb 13 '18 at 16:06
  • I currently have a get function that returns json with 2 parameters token and login, i need store the token parameter server side (it can not be visible to the client). The login parameter contains a login function that the user must use and after login success the user is redirected to a new function where i need the token from the get request along with response from the login. So my token is returned in on http call and will be used in another http call. Is that possible without a database? – Marianne Hammer Larsen Mar 07 '18 at 13:46

0 Answers0