*Move cachedDb to dedicated file
This commit is contained in:
parent
8a6ec42fa6
commit
dfed76acc5
|
@ -22,7 +22,7 @@ import {
|
||||||
CONTENT_MODE_CHUNKED,
|
CONTENT_MODE_CHUNKED,
|
||||||
contentModes,
|
contentModes,
|
||||||
} from "../mimes.js";
|
} from "../mimes.js";
|
||||||
import Dexie from "dexie";
|
import { cacheDb } from "../databases.js";
|
||||||
|
|
||||||
const INDEX_HTML_FILES = ["index.html", "index.htm", "index.shtml"];
|
const INDEX_HTML_FILES = ["index.html", "index.htm", "index.shtml"];
|
||||||
|
|
||||||
|
@ -87,12 +87,6 @@ interface StatFileSubfile {
|
||||||
size: number;
|
size: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cacheDb = new Dexie("LumeWebIFSCache");
|
|
||||||
|
|
||||||
cacheDb.version(1).stores({
|
|
||||||
items: `url,contentType,data,timestamp`,
|
|
||||||
});
|
|
||||||
|
|
||||||
const MAX_CACHE_SIZE = 1024 * 1024 * 1024 * 50;
|
const MAX_CACHE_SIZE = 1024 * 1024 * 1024 * 50;
|
||||||
|
|
||||||
export default class IpfsProvider extends BaseProvider {
|
export default class IpfsProvider extends BaseProvider {
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Dexie from "dexie";
|
||||||
|
|
||||||
|
export const cacheDb = new Dexie("LumeWebIFSCache");
|
||||||
|
|
||||||
|
cacheDb.version(1).stores({
|
||||||
|
items: `url,contentType,data,timestamp`,
|
||||||
|
});
|
Reference in New Issue