From 30ee8c731ce8181f623d9bdd2c729ed5551a23e5 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Sat, 28 Feb 2026 11:08:40 +1100 Subject: [PATCH 1/2] Update cache configuration options and remove deprecated EJS_CacheLimit --- content/1.docs/7.options.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/content/1.docs/7.options.md b/content/1.docs/7.options.md index 85b0463..9a8c1aa 100644 --- a/content/1.docs/7.options.md +++ b/content/1.docs/7.options.md @@ -272,7 +272,7 @@ This will set the size of the ad. An array with the first value is the width and ## Advanced Options -### `EJS_CacheLimit` +### `EJS_CacheLimit` (removed in versions after v4.2.3) The limit to game cache (per rom) in bytes @@ -280,6 +280,40 @@ The limit to game cache (per rom) in bytes - Default: `1073741824` (`1 GB`) - Example: `EJS_CacheLimit = 1024` +### `EJS_cacheConfig` (versions greater than v4.2.3) + +Configures the built in cache - content is now cached after decompression to allow for faster start up times. + +Data is stored in the browsers IndexedDB store, and observes the following rules: +1. The URL is checked against the cache - if it doesn't exist, download it +2. The cacheExpiry property is checked - if it exists and is in the future, use the cached version. Note: the cacheExpiry property is sent by the server in the Cache-Control or Expires headers. If these headers are not present, the cacheExpiry property will be set to 5 days in the future by default. +3. If the cacheExpiry property is in the past or doesn't exist, a HEAD request is made to check the Last-Modified header against the cached version's added date. Falling back to downloading if Last-Modified is not present. +4. If the Last-Modified date is newer than the cached version's added date, download the new version. +5. If none of the above conditions are met, use the cached version. + +::alert{type="info"} + ::list{type="info"} + - *Note*: The cache is far more effective if the web host supports HEAD http requests and ETag headers, as these allow the host to specify how long the object should be cached for, and if any changes to the object have occurred. + :: +:: + +The cache includes the following content types: cores, ROMs, BIOS. + +- Type: `json` +- Default: `{ + enabled: true, + cacheMaxSizeMB: 4096, + cacheMaxAgeMins: 7200 + };` +- Example: +```json +EJS_cacheConfig = { + enabled: true, + cacheMaxSizeMB: 4096, + cacheMaxAgeMins: 7200 +}; +``` + ### `EJS_externalFiles` Allows external files to placed within the EJS file system. From b673ce5457116bfb261a3e6016004030add93549 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:15:20 +1100 Subject: [PATCH 2/2] Deprecate EJS_CacheLimit in documentation for versions after v4.2.3 --- content/1.docs/7.options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/1.docs/7.options.md b/content/1.docs/7.options.md index 9a8c1aa..4b3380d 100644 --- a/content/1.docs/7.options.md +++ b/content/1.docs/7.options.md @@ -272,7 +272,7 @@ This will set the size of the ad. An array with the first value is the width and ## Advanced Options -### `EJS_CacheLimit` (removed in versions after v4.2.3) +### `EJS_CacheLimit` (deprecated in versions after v4.2.3) The limit to game cache (per rom) in bytes