Browse Source
Better cache for DoesSlugExistAsync
pull/17642/head
Enis Necipoglu
2 years ago
No known key found for this signature in database
GPG Key ID: 1EC55E13241E1680
1 changed files with
2 additions and
6 deletions
-
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; |
|
|
|
} |
|
|
|
} |
|
|
|
|