/OutputCacheExample

OutputCache for WebAPI

Primary LanguageC#

OutputCache for WebAPI

  1. Add OutputCache to DI container

    builder.Services.AddOutputCache(configureOptions)
  2. Add OutputCache to middleware

    app.UseOutputCache()
  3. Apply caching to endpoints

    Use method '.CacheOutput()' for minimal endpoints
    or Attribute '[CacheOutput]' in controllers