Make files coming out of the Files tool cacheable, since this improves
performance (e.g., for profile images) and you need to know a highly entropic PHID to access a file in the first place, plus installs should generally be doing HTTPS.
This commit is contained in:
@@ -41,6 +41,7 @@ class PhabricatorFileViewController extends PhabricatorFileController {
|
|||||||
$data = $file->loadFileData();
|
$data = $file->loadFileData();
|
||||||
$response = new AphrontFileResponse();
|
$response = new AphrontFileResponse();
|
||||||
$response->setContent($data);
|
$response->setContent($data);
|
||||||
|
$response->setCacheDurationInSeconds(60 * 60 * 24 * 30);
|
||||||
|
|
||||||
if ($this->view == 'view') {
|
if ($this->view == 'view') {
|
||||||
if (!$file->isViewableInBrowser()) {
|
if (!$file->isViewableInBrowser()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user