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?

3
  • One option is to cache it stackoverflow.com/questions/16443795/caching-data-in-web-api Commented Feb 13, 2018 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 : stackoverflow.com/questions/16443795/caching-data-in-web-api Commented Feb 13, 2018 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? Commented Mar 7, 2018 at 13:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.