1
0
mirror of https://github.com/C9Glax/tranga.git synced 2025-04-18 22:33:18 +02:00

Add Cache-Control headers

This commit is contained in:
Glax 2024-08-26 13:18:48 +02:00
parent 6d723b6355
commit 1bd20791b8

@ -716,6 +716,7 @@ public class Server : GlobalBase
if (content is not Stream)
{
response.ContentType = "application/json";
response.AddHeader("Cache-Control", "no-store");
try
{
response.OutputStream.Write(content is not null
@ -731,6 +732,7 @@ public class Server : GlobalBase
else if(content is FileStream stream)
{
string contentType = stream.Name.Split('.')[^1];
response.AddHeader("Cache-Control", "max-age=600");
switch (contentType.ToLower())
{
case "gif":