Browse Source

Better cache for DoesSlugExistAsync

pull/17642/head
Enis Necipoglu 2 years ago
parent
commit
f7a910187e
No known key found for this signature in database GPG Key ID: 1EC55E13241E1680
  1. 8
      modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs

8
modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Pages/PagePublicAppService.cs

@ -74,12 +74,8 @@ public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppSe
public virtual async Task<bool> DoesSlugExistAsync([NotNull] string slug)
{
var cached = await PageCache.GetAsync(new PageCacheKey(slug));
if (cached is not null)
{
return true;
}
var cached = await FindBySlugAsync(slug);
return await PageRepository.ExistsAsync(slug);
return cached is not null;
}
}

Loading…
Cancel
Save