コード例 #1
0
        public async Task FlushCacheForSiteMutationAsync(HttpRequest request, IUrlHelper url, Guid oid)
        {
            // The endpoint to get this site is the same as any mutation endpoint so generates the same cache key.
            await _cacheService.TryDeleteCacheValueAsync(request, oid); // /api/sites/{siteId}/

            // The get all sites endpoint.
            var allSitesUrl = url.Action(nameof(SitesController.GetSites), "Sites", null, request.Scheme);
            await _cacheService.TryDeleteCacheValueAsync(_cacheService.BuildCacheKeyFromUrl(allSitesUrl, oid)); // /api/sites/
        }