diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Internal/TaskCache.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Internal/TaskCache.cs
new file mode 100644
index 0000000000..c10fd7852e
--- /dev/null
+++ b/src/Microsoft.AspNetCore.Razor.Runtime/Internal/TaskCache.cs
@@ -0,0 +1,24 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading.Tasks;
+
+namespace Microsoft.AspNetCore.Razor.Internal
+{
+ public static class TaskCache
+ {
+
+ ///
+ /// A that's already completed successfully.
+ ///
+ ///
+ /// We're caching this in a static readonly field to make it more inlinable and avoid the volatile lookup done
+ /// by Task.CompletedTask.
+ ///
+#if NET451
+ public static readonly Task CompletedTask = Task.FromResult(0);
+#else
+ public static readonly Task CompletedTask = Task.CompletedTask;
+#endif
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs
index aa826dbbd5..fda0854e62 100644
--- a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs
+++ b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
+using Microsoft.AspNetCore.Razor.Internal;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
@@ -31,7 +32,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
tagMode,
items: new Dictionary