PageSourceSearch

https://fallout-nevada.ru/gamecache.mjs

js fallout-nevada.ru collected 2026-10-08 00:46:19 UTC 1,052 bytes, 41 lines download raw bytes

1import { configuration } from "./config.mjs";
2
3const GAMES_CACHE_PREFIX = "fscache";
4
5const DELIMITER = "____";
6
7/**
8 *
9 * @param {string} game
10 * @param {string} filesVersion
11 */
12export function getCacheName(game, filesVersion) {
13    return [GAMES_CACHE_PREFIX, game, filesVersion].join(DELIMITER);
14}
15
16/**
17 *
18 * @param {string} game
19 * @param {string | null} keepFilesVersion
20 */
21export async function removeGameCache(game, keepFilesVersion) {
22    const keepCache =
23        keepFilesVersion !== null ? getCacheName(game, keepFilesVersion) : null;
24
25    const prefix = [GAMES_CACHE_PREFIX, game, ""].join(DELIMITER);
26    for (const key of await caches.keys()) {
27        if (keepCache !== null && key === keepCache) {
28            continue;
29        }
30        if (key.startsWith(prefix)) {
31            console.info(`Cleaning cache ${key}`);
32            await caches.delete(key);
33        }
34    }
35}
36
37export async function removeOldCache() {
38    for (const game of configuration.games) {
39        await removeGameCache(game.folder, game.filesVersion);
40    }
41}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.