Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion content/1.docs/7.options.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,48 @@ This will set the size of the ad. An array with the first value is the width and

## Advanced Options

### `EJS_CacheLimit`
### `EJS_CacheLimit` (deprecated in versions after v4.2.3)

The limit to game cache (per rom) in bytes

- Type: `number`
- 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.
Expand Down