Skip to content

Commit

Permalink
Left part of URI (scheme and authority) for cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfio committed May 16, 2024
1 parent 5529f54 commit 73747fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ private void RemoveEntityFromCache(IContent entity)
.Select(info => new Uri(info.Text));

foreach (var uri in uris.Concat(otherUris))
_invisibleNodeCache.ClearRoute(uri.Authority, uri.AbsolutePath);
_invisibleNodeCache.ClearRoute(uri.GetLeftPart(UriPartial.Authority), uri.AbsolutePath);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2023 Luke Fisher
// SPDX-License-Identifier: Apache-2.0

using System;
using System.Linq;
using System.Threading.Tasks;
using Our.Umbraco.InvisibleNodes.Core;
Expand Down Expand Up @@ -32,7 +33,7 @@ public Task<bool> TryFindContent(IPublishedRequestBuilder request)
if (!_umbracoContextAccessor.TryGetUmbracoContext(out var context) || context.Content is null)
return Task.FromResult(false);

string host = request.Uri.Authority;
string host = request.Uri.GetLeftPart(UriPartial.Authority);
string path = request.Uri.AbsolutePath;

int? cached = _invisibleNodeCache.GetRoute(host, path);
Expand Down

0 comments on commit 73747fc

Please sign in to comment.