Skip to content

Commit

Permalink
fix snippet rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
tdykstra committed Jul 5, 2024
1 parent e82d415 commit 7ab5fdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion aspnetcore/performance/caching/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Add the middleware to the request processing pipeline by calling <xref:Microsoft

For example:

:::code language="csharp" source="~/performance/caching/output/samples/7.x/Program.cs" id="snippet_addanduse":::
:::code language="csharp" source="~/performance/caching/output/samples/7.x/Program.cs" id="policies4":::
:::code language="csharp" source="~/performance/caching/output/samples/7.x/Program.cs" id="snippet_use":::

Calling `AddOutputCache`and `UseOutputCache` doesn't start caching behavior, it makes caching available. To make the app cache responses, caching must be configured as shown in the following sections.

Expand Down
5 changes: 2 additions & 3 deletions aspnetcore/performance/caching/output/samples/7.x/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,18 @@ public static void Main(string[] args)
//</policies3c>
#endif
#if Version4
//<snippet_addanduse>
//<policies4>
builder.Services.AddOutputCache();
//</policies4>
#endif

//<snippet_use>
var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseHttpsRedirection();
app.UseOutputCache();
app.UseAuthorization();
//</snippet_addanduse>
//</snippet_use>


app.MapGet("/", Gravatar.WriteGravatar);
Expand Down

0 comments on commit 7ab5fdf

Please sign in to comment.