From f508d12ba8dfc5f009670faf629e9a4521396e62 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Mon, 24 Feb 2025 08:05:37 -0300 Subject: [PATCH] feat(smalltrip): TODO PersistentCache middlware --- middleware/cache.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/middleware/cache.go b/middleware/cache.go index a448fd6..7d1154a 100644 --- a/middleware/cache.go +++ b/middleware/cache.go @@ -28,6 +28,13 @@ func SmartCache(options ...CacheOption) Middleware { return Cache(options...) } +// TODO: PersistentCache is a smarter implementation of SmartCache that handles requests +// with authorization, Cache-Control from the client, and stores responses into +// a persistent storage solution like Redis. +func PersistentCache(options ...CacheOption) Middleware { + return SmartCache(options...) +} + type CacheOption func(*directives) func CacheMaxAge(t time.Duration) CacheOption {