I have a really strange problem. I'm using object cache to faster retrieve results when using SPQuery.
My code to get items is as follows:
PortalSiteMapProvider ps = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode; var items = ps.GetCachedListItemsByQuery(((PortalSiteMapNode)ps.CurrentNode).WebNode, "mylistname", myQuery, site.RootWeb);
When I run this code I get all results which satisfies condition in query (no matter how many times I refresh page). However if I make any changes to list (add or delete item), the object cache returns the changed set of items only once. Next time I refresh page I get 0 results.
E.g. if I had 5 items and then I add 1 new item, I get 6 items which is correct result. But when I refresh page again I get 0 results. This state persists until I recycle app pool or flush object cache.
My Object cache is set to 300MB, it's checking for changes when query is executed and multiplier value is set to 3.
Any ideas what could be source of my problems?
Any advice is welcomed! Thanks.
I looked into ULS and found this entries when 0 items are returned:
Cache miss for query Web (nor all entries not found) "query .... " Fetching 4294967295 items. Fetching super user items. Fetching SuperReader items. Merging super user and super reader items. Cache Hit for query Web "query ... " Creating result set. Adding super user IDs. Adding Super Reader IDs. Nothing from SuperReaders.