ASP.Net Performance
-
Hi All, I am developing web application so certain thing i need to store in session variable like role id of user. Right now i am using
Session["id"] =""
should i use the following code or i can use
Cache["var"] =""
Is that effect performance of the application. Thanks and regards, Amit Patel
-
Hi All, I am developing web application so certain thing i need to store in session variable like role id of user. Right now i am using
Session["id"] =""
should i use the following code or i can use
Cache["var"] =""
Is that effect performance of the application. Thanks and regards, Amit Patel
Amit Patel1985 wrote:
Session["id"] ="" should i use the following code or i can use Cache["var"] =""
Session is Unique for each user. Whenever client send a request the session will kept in Server and its unique and can't be accessible for all. So you should store information that is related with current user in session like Username, id etc. Cache is global for. When all data need to share for all of the user you can use data caching. Like if you want to share global address to all users. Please let me know if you need more information on the same.
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Hi All, I am developing web application so certain thing i need to store in session variable like role id of user. Right now i am using
Session["id"] =""
should i use the following code or i can use
Cache["var"] =""
Is that effect performance of the application. Thanks and regards, Amit Patel
Always place sensitive data in session.... (User Specific) Cache is accessible to all users. So Session is best choice on this regard. ;) If you dont put any large serialization types into Session variables.. There is no problem...
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Always place sensitive data in session.... (User Specific) Cache is accessible to all users. So Session is best choice on this regard. ;) If you dont put any large serialization types into Session variables.. There is no problem...
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using JavascriptHi, I agree with abhishake
Farogh Haider Web developer