Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using vb.net and asp.net. My web application is used by multiple parallel users . I have a table named "Tracked_Table"

I want to cache this table for 10 seconds and after 10 seconds, i wanted to reload the cache again with the latest "Tracked_Table" data.
I have tried on the Below code.. (ASP.NET AND VB.NET)
-- In page Load:
If Cache("tracked") Is Nothing Then
    FillCache()
ElseIf (DateTime.Now() - Convert.ToDateTime(Cache("timestamp"))).TotalSeconds > 10 Then
    FillCache()
End If

DisplayTrackedTable() ' --Here i am using the Cache("tracked") table..
-- End of pageload
In the Fillcache function , the below code i hv written.
** vehicleTrackedDict --> The dictionary containing the "tracked_table" data
Cache.Remove("tracked")
Cache.Remove("timestamp")
Cache("timestamp") = Now.ToString("yyyy/MM/dd HH:mm:ss")
Cache("tracked") = vehicleTrackedDict

This is the whole thing i am trying to use cache..
But this code seems to be not working perfectly for Parallel multiple users.
Can any one helps me out for this..
Posted
Updated 6-Oct-14 21:23pm
v2

1 solution

Hi,

Refer this link - Caching
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900