This repository was archived by the owner on Apr 8, 2020. It is now read-only.
File tree 2 files changed +10
-4
lines changed
samples/angular/MusicStore/Views/Home
src/Microsoft.AspNetCore.AngularServices
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
<cache vary-by =" @Context.Request.Path" >
6
6
<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"))
9
9
</cache >
10
10
11
11
@section scripts {
Original file line number Diff line number Diff line change @@ -11,9 +11,15 @@ namespace Microsoft.AspNetCore.AngularServices
11
11
{
12
12
public static class PrimeCacheHelper
13
13
{
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 )
15
16
{
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
17
23
// the same URL, only return nonempty for one of them). This will make it easier to auto-prime-cache any
18
24
// HTTP requests made during server-side rendering, without risking unnecessary duplicate requests.
19
25
You can’t perform that action at this time.
0 commit comments