mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #9971 from appwrite/fix-deployment-download-2
Fix cache issues with proxy for deployment download
This commit is contained in:
commit
9866e6fa2f
2 changed files with 8 additions and 4 deletions
|
|
@ -105,9 +105,11 @@ class Get extends Action
|
||||||
|
|
||||||
$response
|
$response
|
||||||
->setContentType('application/gzip')
|
->setContentType('application/gzip')
|
||||||
->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days
|
->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
|
||||||
|
->addHeader('Expires', '0')
|
||||||
|
->addHeader('Pragma', 'no-cache')
|
||||||
->addHeader('X-Peak', \memory_get_peak_usage())
|
->addHeader('X-Peak', \memory_get_peak_usage())
|
||||||
->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '.tar.gz"');
|
->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"');
|
||||||
|
|
||||||
$size = $device->getFileSize($path);
|
$size = $device->getFileSize($path);
|
||||||
$rangeHeader = $request->getHeader('range');
|
$rangeHeader = $request->getHeader('range');
|
||||||
|
|
|
||||||
|
|
@ -99,12 +99,14 @@ class Get extends Action
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$device->exists($path)) {
|
if (!$device->exists($path)) {
|
||||||
throw new Exception(Exception::BUILD_NOT_FOUND);
|
throw new Exception(Exception::DEPLOYMENT_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response
|
$response
|
||||||
->setContentType('application/gzip')
|
->setContentType('application/gzip')
|
||||||
->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache
|
->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
|
||||||
|
->addHeader('Expires', '0')
|
||||||
|
->addHeader('Pragma', 'no-cache')
|
||||||
->addHeader('X-Peak', \memory_get_peak_usage())
|
->addHeader('X-Peak', \memory_get_peak_usage())
|
||||||
->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"');
|
->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue