|
@@ -778,9 +778,15 @@ try
|
|
case 'download_document':
|
|
case 'download_document':
|
|
$id = utils::ReadParam('id', '');
|
|
$id = utils::ReadParam('id', '');
|
|
$sField = utils::ReadParam('field', '');
|
|
$sField = utils::ReadParam('field', '');
|
|
|
|
+ $iCacheSec = (int) utils::ReadParam('cache', 0);
|
|
if (!empty($sClass) && !empty($id) && !empty($sField))
|
|
if (!empty($sClass) && !empty($id) && !empty($sField))
|
|
{
|
|
{
|
|
DownloadDocument($oPage, $sClass, $id, $sField, 'attachment');
|
|
DownloadDocument($oPage, $sClass, $id, $sField, 'attachment');
|
|
|
|
+ if ($iCacheSec > 0)
|
|
|
|
+ {
|
|
|
|
+ $oPage->add_header("Expires: "); // Reset the value set in ajax_page
|
|
|
|
+ $oPage->add_header("Cache-Control: no-transform,public,max-age=$iCacheSec,s-maxage=$iCacheSec");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|