How to configure Edgemesh® Client

There are two ways to configure the Edgemesh® Client: through the Edgemesh® Portal and via the EDGEMESH global variable in your source code.

Portal Configuration

The Edgemesh® Portal provides an interface to configure boolean options related to cache control and feature flags. These options can be set without the need for a code update. Below are the available configuration options in the portal:

image

description

Cache image resources.

type
boolean
default
true
extensions
bmp, bpg, eps, gif, ico, jpeg, jpg, pict, png, svg, svgz, tif, tiff, webp

video

description

Cache video resources.

type
boolean
default
true
extensions
amv, avi, drc, f4bogv, f4p, f4v, flv, gifv, m2v, m4v, mkv, mov, mp2, mp4, mpe, mpeg, mpg, mpv, qt, webm, wmv, 3g2, 3gp

audio

description

Cache audio resources.

type
boolean
default
true
extensions
aac, aiff, f4a, flac, m4a, m4p, mid, midi, mogg, mp3, ogg, oga, opus, ra, rm, wav

stylesheet

description

Cache stylesheet resources.

type
boolean
default
true
extensions
css

font

description

Cache font resources.

type
boolean
default
true
extensions
ttf, otf, woff, woff2, eot

application

description

Cache application resources.

type
boolean
default
true
extensions
js, json, swf, wat, wasm

archive

description

Cache archive resources.

type
boolean
default
true
extensions
apk, bz2, dmg, gz, iso, jar, lz, lzma, rar, tar, tbz2, tgz, tlz, txz, xz, z, zip, zipx, 7z

document

description

Cache document resources.

type
boolean
default
true
extensions
doc, docx, otf, pdf, ppt, pptx, ps, xls, xlsx

html

description

Cache HTML (navigation) resources.

type
boolean
default
false
extensions
htm, html, mode = navigation

lite

description

Enable lite (metrics only) mode.

type
boolean
default
false

prefetch

description

Enable intelligent prefetching.

type
boolean
default
false

pause

description

Pause caching.

type
boolean
default
false

These options can be configured through the domain settings page in the Edgemesh® Portal.

Global Variable

The global variable allows you to configure options that are required at start time, before the Portal Configuration is received. These options are related to endpoint configuration and feature overrides. Any options set in the global variable will override their counterpart in the Edgemesh® Portal. You can find a list of options that can be set in the global variable in the reference documentation.

Example with Default Configuration
<script type="application/javascript">
EDGEMESH = {
host: 'https://api.edgeme.sh',
swUrl: '/sw.js'
scope: '/',
lite: false,
topicDepth: 0,
prefetch: false
}
</script>
<script async type="application/javascript" src="https://static.edgeme.sh/client.js"></script>

Made withby Edgemesh Corporation