From dec6bcb1a1cc079842c1e0fefebf162f48daac32 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 --- smalltrip/middleware/cache.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smalltrip/middleware/cache.go b/smalltrip/middleware/cache.go index a448fd6..7d1154a 100644 --- a/smalltrip/middleware/cache.go +++ b/smalltrip/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 {