J
J055
Hi
I've implemented caching for my ObjectDataSource.
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
EnableCaching="True" CacheDuration="10" CacheExpirationPolicy="Sliding"
SelectMethod="GetUsers" TypeName="BizObject"></asp:ObjectDataSource>
This works, however I need to explicitly clear/remove the cache when I
delete record(s). (It's a custom delete, not a ObjectDataSource builtin
one.) I understand that I need to set the CacheKeyDependency property so
that I can Remove it from the cache?
When I add this line to the above the cache stops working, i.e. the
SelectMethod retrieves the data from the database each time.
CacheKeyDependency="GVkey"
Can someone point me in the right direction? How do I see what's in the
cache? If I write this out it is always zero even when the cache is working.
Literal1.Text = "The number of items in the cache:" +
Cache.Count.ToString();
Very confused. Thanks
Andrew
I've implemented caching for my ObjectDataSource.
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
EnableCaching="True" CacheDuration="10" CacheExpirationPolicy="Sliding"
SelectMethod="GetUsers" TypeName="BizObject"></asp:ObjectDataSource>
This works, however I need to explicitly clear/remove the cache when I
delete record(s). (It's a custom delete, not a ObjectDataSource builtin
one.) I understand that I need to set the CacheKeyDependency property so
that I can Remove it from the cache?
When I add this line to the above the cache stops working, i.e. the
SelectMethod retrieves the data from the database each time.
CacheKeyDependency="GVkey"
Can someone point me in the right direction? How do I see what's in the
cache? If I write this out it is always zero even when the cache is working.
Literal1.Text = "The number of items in the cache:" +
Cache.Count.ToString();
Very confused. Thanks
Andrew