---
title: "Exploring the new output caching middleware"
url: https://daily.dev/posts/exploring-the-new-output-caching-middleware-qd872mfev
source_url: https://timdeschryver.dev/blog/exploring-the-new-output-caching-middleware
type: article
source: "Tim Deschryver"
author: "Tim Deschryver"
published: 2026-05-31T07:47:25.249Z
updated: 2026-06-01T04:00:48.306Z
tags: [".net", "aspnetcore"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Exploring the new output caching middleware

**[Tim Deschryver](https://daily.dev/sources/timdeschryver)** · [@timdeschryver](https://daily.dev/timdeschryver) · 7 min read · 0 upvotes · 0 comments

## Summary

The new output caching middleware in .NET 7 Preview 6 brings a flexible and easy-to-use caching layer to ASP.NET APIs. Setup requires just two extension methods (AddOutputCache and UseOutputCache). By default, caching keys on the full URL including query parameters, but this can be customized using VaryByQuery, VaryByHeader, or VaryByValue. Cache expiration, cache tags for targeted purging, route groups, named policies, and base policies are all supported. The middleware works with both minimal APIs and traditional controllers. Authorized requests are excluded from caching by default, and simultaneous cache-miss requests are coalesced so the handler runs only once.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://timdeschryver.dev/blog/exploring-the-new-output-caching-middleware>

## Similar posts on daily.dev

- [How to implement caching in ASP.NET Core minimal APIs](https://daily.dev/posts/how-to-implement-caching-in-asp-net-core-minimal-apis-mexg4z2ck) · InfoWorld · 3 upvotes · 0 comments
- [Implementing RFC-compliant HTTP caching for HttpClient in .NET](https://daily.dev/posts/implementing-rfc-compliant-http-caching-for-httpclient-in-net-ckf4syuwc) · Meziantou · 5 upvotes · 1 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#aspnetcore](https://daily.dev/tags/aspnetcore)

[View this post on daily.dev](https://daily.dev/posts/exploring-the-new-output-caching-middleware-qd872mfev)
