mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
ui: fix cache filter
This commit is contained in:
1 parent
4b74ebbeba
commit
6cc0cd4e95
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.46.1",
|
||||
"version": "4.46.2",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "index.ts",
|
||||
|
||||
@@ -22,8 +22,8 @@ const PRECACHE = `precache-${process.env.VERSION}`;
|
||||
const DO_NOT_CACHE = ['vditor', '.worker.js', 'fonts', 'i.monaco'];
|
||||
|
||||
function shouldCache(name: string, request?: Request) {
|
||||
if (!name.split('/').pop()) return false;
|
||||
if (!name.split('/').pop().includes('.')) return false;
|
||||
if (!name.split('?')[0].split('/').pop()) return false;
|
||||
if (!name.split('?')[0].split('/').pop().includes('.')) return false;
|
||||
if (process.env.NODE_ENV !== 'production' && (name.includes('.hot-update.') || name.includes('?version='))) return false;
|
||||
// For files download, a response is formatted as string
|
||||
if (request && request.headers.get('Pragma') === 'no-cache') return false;
|
||||
|
||||
Reference in new issue
Block a user