Skip to content

EspoCRM – Open Source CRM Application

attachment cache header change

Yuri Kuznetsovfe70eba7d69e
diff --git a/application/Espo/EntryPoints/Attachment.php b/application/Espo/EntryPoints/Attachment.php
index 8fedadd7e0..19bc3429aa 100644
--- a/application/Espo/EntryPoints/Attachment.php
+++ b/application/Espo/EntryPoints/Attachment.php
@@ -94,6 +94,7 @@ class Attachment implements EntryPoint
$response
->setHeader('Content-Length', (string) $size)
+ ->setHeader('Cache-Control', 'private, max-age=864000, immutable')
->setHeader('Content-Security-Policy', "default-src 'self'")
->setBody($stream);
}
diff --git a/application/Espo/EntryPoints/Image.php b/application/Espo/EntryPoints/Image.php
index 1c5b362400..bdc49d1864 100644
--- a/application/Espo/EntryPoints/Image.php
+++ b/application/Espo/EntryPoints/Image.php
@@ -147,7 +147,7 @@ class Image implements EntryPoint
$response
->setHeader('Content-Disposition', 'inline;filename="' . $fileName . '"')
- ->setHeader('Cache-Control', 'max-age=360000, must-revalidate')
+ ->setHeader('Cache-Control', 'private, max-age=864000, immutable')
->setHeader('Content-Length', (string) $fileSize)
->setHeader('Content-Security-Policy', "default-src 'self'");
}