File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
samples/angular/MusicStore/Views/Home
src/Microsoft.AspNetCore.AngularServices Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 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 {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments