I am trying to build a system to list items within my Back office system on eBay via the eBay ASP.NET SDK.
Since loading eBay categories isn't terribly fast, and infrequently changing, I figured I'd cache the responses from the requests I'll make.
I have a function which returns a list of eBay categories as an eBay CategoryTypeCollection
and I am trying to Cache it, then check for it and retrieve new if necessary:
Dim CategoryList As New CategoryTypeCollection
If HttpRuntime.Cache.Get("eBayCategories") Is Nothing Then
CategoryList = Categories.DisplayCategories()
HttpRuntime.Cache.Insert("eBayCategories", CategoryList, Nothing, DateTime.UtcNow.AddMinutes(30), TimeSpan.FromMinutes(0))
Else
CategoryList = HttpRuntime.Cache.Get("eBayCategories")
End If
However, it is always getting new data.
This is part of a much bigger project, and caching is working for other things, I can't see what I am doing wrong here?