web端发一个新微博 我的手机端是获取 PagingDataSet<MicroblogEntity> 对象 使用分区缓存 不能及时拿到数据 求大虾的解答
return GetPagingEntities(pageSize, pageIndex, CachingExpirationType.ObjectCollection, () =>
{
StringBuilder cacheKey = new StringBuilder(RealTimeCacheHelper.GetListCacheKeyPrefix(CacheVersionType.AreaVersion, "UserId", userId));
cacheKey.Append("OwnerActivities::");
cacheKey.AppendFormat("UserId-{0}:", userId);
cacheKey.AppendFormat("pageIndex-{0}", pageIndex);
if (pageSize > 0)
cacheKey.AppendFormat("pageSize-{0}", pageSize);
if (!string.IsNullOrEmpty(sortBy.ToString()))
cacheKey.AppendFormat("sortBy-{0}", sortBy);
return cacheKey.ToString();
}, () =>
{
Sql sql = Sql.Builder;
sql.From("spb_Microblogs")
.Where("UserId in(" + id + ")")
.Where("AuditStatus=40");
sql.OrderBy(sortBy + " desc");
return sql;
});
如果我压力测试 同时发微博 同时获取微博 那缓存不就是没效果了