Release/versao1 #18
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user