* cache file read image.

This commit is contained in:
wangyidong
2019-07-23 13:45:54 +08:00
parent 7337f28144
commit a1bf91fb7b
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -168,7 +168,8 @@ $(document).ready(function()
var resizeCols = function() {
var cellHeight = $(window).height() - $('#footer').outerHeight() - $('#header').outerHeight() - 42;
$cols.children('.panel').height(cellHeight).css('maxHeight', cellHeight).find('.panel-body').css('position', 'absolute');
$cols.find('.tab-content').height(cellHeight - $cols.find('.nav-tabs').height() - 35).css('maxHeight', cellHeight - $cols.find('.nav-tabs').height() - 35).css('overflow-y', 'auto');
var sideHeight = cellHeight - $cols.find('.nav-tabs').height() - $cols.find('.side-footer').height() - 35;
$cols.find('.tab-content').height(sideHeight).css('maxHeight', sideHeight).css('overflow-y', 'auto');
};
$(window).on('resize', resizeCols);
+6
View File
@@ -502,6 +502,12 @@ class file extends control
$mime = in_array($file->extension, $this->config->file->imageExtensions) ? "image/{$file->extension}" : $this->config->file->mimes['default'];
header("Content-type: $mime");
$cacheMaxAge = $this->config->cookieLife - time();
header("Cache-Control: private");
header("Pragma: cache");
header("Expires:" . gmdate("D, d M Y H:i:s", $this->config->cookieLife) . " GMT");
header("Cache-Control: max-age=$cacheMaxAge");
$handle = fopen($file->realPath, "r");
if($handle)
{