1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-23 04:01:25 +00:00

use image last modified time to remove browser cache (#7554)

* use image last modified time to remove browser cache

* remove useless
This commit is contained in:
Michael An
2025-03-05 17:01:54 +08:00
committed by GitHub
parent e8de9ba848
commit a83adb7929
28 changed files with 107 additions and 164 deletions

View File

@@ -7,7 +7,7 @@ import { gettext, siteRoot } from './utils/constants';
import './css/image-file-view.css';
const { fileName, rawPath, err, prevImgPath, nextImgPath, repoEncrypted, fileExt, filePath, sharedToken } = window.shared.pageOptions;
const { fileName, rawPath, err, prevImgPath, nextImgPath, repoEncrypted, fileExt, filePath, sharedToken, lastModified } = window.shared.pageOptions;
const { thumbnailSizeForOriginal } = window.app.pageOptions;
const prevImgURL = `?p=${encodeURIComponent(prevImgPath)}`;
@@ -41,7 +41,7 @@ class FileContent extends React.Component {
let thumbnailURL = '';
const fileExtList = ['tif', 'tiff', 'psd', 'heic'];
if (!repoEncrypted && fileExtList.includes(fileExt)) {
thumbnailURL = `${siteRoot}thumbnail/${sharedToken}/${thumbnailSizeForOriginal}${Utils.encodePath(filePath)}`;
thumbnailURL = `${siteRoot}thumbnail/${sharedToken}/${thumbnailSizeForOriginal}${Utils.encodePath(filePath)}?mtime=${lastModified}`;
}
return (