Release/versao1 #18

Merged
ricardo merged 8 commits from Release/versao1 into main 2025-09-22 18:37:52 +00:00
Showing only changes of commit dc00ea97a9 - Show all commits

View File

@ -53,10 +53,13 @@ namespace BCards.Web.Middleware
// Só adicionar se não foi definido explicitamente pelo controller // Só adicionar se não foi definido explicitamente pelo controller
if (!context.Response.Headers.ContainsKey("Cache-Control")) if (!context.Response.Headers.ContainsKey("Cache-Control"))
{ {
context.Response.Headers["Cache-Control"] = "no-cache, must-revalidate"; // Headers mais fortes para garantir que CDNs como Cloudflare não façam cache
context.Response.Headers["Vary"] = "Cookie"; context.Response.Headers["Cache-Control"] = "no-store, no-cache, must-revalidate, proxy-revalidate";
context.Response.Headers["Pragma"] = "no-cache";
_logger.LogDebug("AuthCache: Applied no-cache for authenticated user on {Path}", path); context.Response.Headers["Expires"] = "0";
context.Response.Headers["Vary"] = "Cookie, Authorization";
_logger.LogDebug("AuthCache: Applied strong no-cache headers for authenticated user on {Path}", path);
} }
} }
else else