Moves UrlExtensions methods to new service and reduce the huge amount of allocated strings during routing

This commit is contained in:
Shannon
2021-01-08 17:21:35 +11:00
parent e1e3200313
commit 0ce90cf359
29 changed files with 473 additions and 521 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
@@ -11,6 +11,7 @@ using Umbraco.ModelsBuilder.Embedded.Building;
using Umbraco.Web.Cache;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
using Umbraco.Extensions;
namespace Umbraco.ModelsBuilder.Embedded
{
@@ -115,12 +116,16 @@ namespace Umbraco.ModelsBuilder.Embedded
public void AppEndRequest(HttpContext context)
{
var requestUri = new Uri(context.Request.GetEncodedUrl(), UriKind.RelativeOrAbsolute);
if (requestUri.IsClientSideRequest())
if (context.Request.IsClientSideRequest())
{
return;
}
if (!IsEnabled)
{
return;
}
if (!IsEnabled) return;
GenerateModelsIfRequested();
}
}