You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just saw a very interesting .net conf about aspnetcore where you were presenting. I believe i heard that you said, not stateless static is bad. And i could not agree.
Is HttpContecxt in the controller stateless?
I remember we could start injecting the IHttpContextAccessor in aspnetcore but it was later stated that it came with a performance hit. Is there a new/better way to use the HttpContext as a none static? Or is the none HttpContext "ok" as being with a state?
Hello there,
the concept of stateless refers to the idea that each HTTP request should be independent and should not rely on any server-side state that persists between requests. This ensures that web applications can scale effectively, as requests can be distributed across different servers without any server needing to retain user-specific data between requests. HttpContext itself is not stateless and it represents all information about an individual HTTP request. However, its use is transient and tied to the lifecycle of a single request. Each HttpContext instance is created at the beginning of a request and disposed of at the end. This means that while HttpContext is stateful within the scope of a single request, it does not retain state across multiple requests.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi @davidfowl (or anyone)
I just saw a very interesting .net conf about aspnetcore where you were presenting. I believe i heard that you said, not stateless static is bad. And i could not agree.
Is HttpContecxt in the controller stateless?
I remember we could start injecting the IHttpContextAccessor in aspnetcore but it was later stated that it came with a performance hit. Is there a new/better way to use the HttpContext as a none static? Or is the none HttpContext "ok" as being with a state?
Beta Was this translation helpful? Give feedback.
All reactions