Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 56cb898

Browse files
Rename PrimeCache to PrimeCacheAsync (keeping older name as obsolete overload). Fixes #246.
1 parent c53bd8f commit 56cb898

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

samples/angular/MusicStore/Views/Home/Index.cshtml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
<cache vary-by="@Context.Request.Path">
66
<app asp-prerender-module="wwwroot/ng-app/boot-server">Loading...</app>
7-
@await Html.PrimeCache(Url.Action("GenreMenuList", "GenresApi"))
8-
@await Html.PrimeCache(Url.Action("MostPopular", "AlbumsApi"))
7+
@await Html.PrimeCacheAsync(Url.Action("GenreMenuList", "GenresApi"))
8+
@await Html.PrimeCacheAsync(Url.Action("MostPopular", "AlbumsApi"))
99
</cache>
1010

1111
@section scripts {

src/Microsoft.AspNetCore.AngularServices/PrimeCacheHelper.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ namespace Microsoft.AspNetCore.AngularServices
1111
{
1212
public static class PrimeCacheHelper
1313
{
14-
public static async Task<HtmlString> PrimeCache(this IHtmlHelper html, string url)
14+
[Obsolete("Use PrimeCacheAsync instead")]
15+
public static Task<IHtmlContent> PrimeCache(this IHtmlHelper html, string url)
1516
{
16-
// TODO: Consider deduplicating the PrimeCache calls (that is, if there are multiple requests to precache
17+
return PrimeCacheAsync(html, url);
18+
}
19+
20+
public static async Task<IHtmlContent> PrimeCacheAsync(this IHtmlHelper html, string url)
21+
{
22+
// TODO: Consider deduplicating the PrimeCacheAsync calls (that is, if there are multiple requests to precache
1723
// the same URL, only return nonempty for one of them). This will make it easier to auto-prime-cache any
1824
// HTTP requests made during server-side rendering, without risking unnecessary duplicate requests.
1925

0 commit comments

Comments
 (0)