This section only applies to Edgecast Applications version 4 and earlier. Proceed to the Upgrade Node.js step if you are using a later version.
Edgecast Applications now uses Edgecast branding for our CLI, packages, and a configuration file. Additionally, our service will no longer modify duplicate query string parameters.
Perform the following steps for each of your properties:
Rename layer0.config.js to edgio.config.js.
Edgecast Applications version 5+ ignores the layer0.config.js configuration file.
Rename all references to Edgecast packages from @layer0 to @edgio.
package.json: In addition to renaming the Edgecast packages, you should also set their version to ^7.0.0.
For example, the following excerpt from a package.json file references several @layer0 packages:
JSONpackage.json version 4 and earlier
1...
2"dependencies":{
3"@layer0/rum":"4.18.1",
4},
5"devDependencies":{
6"@layer0/cli":"4.18.1",
7"@layer0/core":"4.18.1",
8"@layer0/devtools":"4.18.1",
9...
You should update all of these references as shown below.
JSONpackage.json version 7
1...
2"dependencies":{
3"@edgio/rum":"^7.0.0",
4},
5"devDependencies":{
6"@edgio/cli":"^7.0.0",
7"@edgio/core":"^7.0.0",
8"@edgio/devtools":"^7.0.0",
9...
There may be additional @layer0/* dependencies listed in your site’s package.json file that are not listed above. Update those dependencies to @edgio/*. After which, there should be no remaining @layer0/* references in the file.
Import Statements: Rename Edgecast packages within each import statement from @layer0 to @edgio. You can find these import statements within various files, such as routes.ts, sw/service-worker.js, and your Next and Nuxt configuration files.
For example, the following excerpt from a routes.ts file imports various @layer0 packages:
Version 7 no longer requires the withServiceWorker function to be explicitly defined within the next.config.js file and therefore it may be safely removed.
Install the dependencies defined in the previous step.
Bash
1npm install
This should generate an updated dependency tree in your package-lock.json or yarn.lock file. Be sure to commit these changes.
Update all references to the Edgecast CLI within your package.json scripts from 0 | layer0 to either edg or edgio.
Exclude build artifacts from being tracked in version control by updating your .gitignore file to:
Edgecast Applications version 7.4.0+ runs your apps in Node.js v18 or v20. Therefore, we strongly recommend that you use Node.js v18.x or 20.x when developing your web application.
Once you are using Node.js v18 or v20, update your application code to be compatible with your updated version of Node.js.
If package.json or .npmrc explicitly sets the Node.js engine version to 14.x, then you will need to update it to 18.x or 20.x.
Additionally, check your CI/CD environment for Node.js version settings. If your workflow targets Node.js 14.x, then you will need to update your files and settings to target Node.js 18.x or 20.x.
Although you already have an existing account through app.layer0.co, you will need to sign up for a new account through app.edgecast.io using the same email address, Google account, or Github account.
If you are an enterprise customer, contact your account manager or our sales department at 1 (866) 200 - 5463 to upgrade your newly created organization.
From the Edgecast Console, determine where you will create a property.
Private Space: By default, the Edgecast Console loads your private space. Access to a property created in your private space is restricted to your account. Proceed to the next step.
Organization: Load the desired organization by clicking the icon that appears next to your name and then selecting the desired organization.
Click New Property.
From under the Host Property on Edgecast, click Create Property.
In the Property Name option, assign a unique name to this property.
Verify that the Create using CLI option is selected.
Click Create Property.
A quick start page will display a npx command that:
Installs the latest version of the Edgecast CLI.
By default, Edgecast CLI v5.1+ collects usage and error reporting information to help improve our products. However, it omits personally identifiable information. Learn how to opt-out.
Initializes your property.
Run this command from your project’s root directory. Upon running the above command:
The Edgecast CLI will require that you log in to the Edgecast if it does not detect an active Edgecast session.
You will need to authorize the CLI by granting it a token through which it may deploy your property to Edgecast.
The CLI should automatically configure your property according to the detected framework. It will create a default and a production environment. Although production traffic can be served through either environment, we recommend that you use the production environment to serve production traffic. Cloud Function requests to the production environment are prioritized over other environments when heavy traffic is experienced.
If you are not using a supported framework, then you will be prompted to provide additional information. Learn more.
As mentioned in the previous step, Edgecast automatically creates a default and a production environment upon initializing a property. If you require additional environment(s), then you should create them now.
Update all Edgecast packages to version 7 using the CLI.
Bash
1edgio use ^7.0.0
If you are upgrading from version 4 and earlier, then you should have already upgraded to version 7. In which case, the above step will indicate that your packages are up to date.
Update each property’s edgio.config.js as indicated below.
backends: The backends property has been replaced with the origins property. We recommend that you define them on a per environment basis through the environments property.
For example, we will assume that your backends property is configured as follows:
JavaScriptedgio.config.js version 6 and earlier
1backends:{
2origin:{
3// The domain name or IP address of the origin server
4domainOrIp:"origin.mysite.com",
5
6// When provided, the following value will be sent as the host header when connecting to the origin.
7// If omitted, the host header from the browser will be forwarded to the origin.
8hostHeader:"www.mysite.com",
9
10// Uncomment the following line if TLS is not set up properly on the origin domain and you want to ignore TLS errors
11// disableCheckCert: true,
12
13// Overrides the default ports (80 for http and 443 for https) and instead use a specific port
14// when connecting to the origin
15// port: 1337,
16},
17}
The equivalent configuration in version 7 is shown below.
JavaScriptedgio.config.js version 7
1...
2environments:{
3// Serve production traffic through the production environment.
4production:{
5origins:[
6{
7// the key in backends
8name:'origin',
9
10// from hostHeader
11override_host_header:'www.mysite.com',
12
13// Version 7 introduces the ability to load balance across multiple origin hosts.
14// Previous versions only supported a single host per origin.
15hosts:[
16{
17scheme:'https',
18location:[
19{
20// from domainOrIp
21hostname:'origin.mysite.com',
22
23// from port
24port:443,
25},
26],
27},
28],
29
30// In version 7, you may enable Server Name Indication (SNI) and define a SNI hint.
31// This configuration is essential when using multiple domains, since it allows us to
32// present to the browser a certificate with the correct name during the TLS handshake.
33
34tls_verify:{
35use_sni:true,
36sni_hint_and_strict_san_check:'www.mysite.com',
37},
38
39// In version 7, the location of the shield (formerly referred to as the “global” PoP) is
40// configured in edgio.config.js instead of the Edgecast Console
41// Previous versions only supported a single shield in a single region.
42
43// If your Edgecast cloud region is US East, use:
44shields:{us_east:'DCD'},
45
46// If your Edgecast cloud region is US West, instead use:
47// shields: { us_west: 'SAC'},
48
49// Uncomment the following lines to define a configuration equivalent to disableCheckCert: true
50// tls_verify: {
51// allow_self_signed_certs: true,
52// },
53},
54],
55},
56},
Hostnames: In Edgecast Applications version 6 and earlier, custom domains are defined on a per environment basis within the Edgecast Console. In version 7, if you are using CDN-as-code, we recommend that you define them on a per environment basis through the environments property. The following excerpt of a sample configuration demonstrates how to define hostnames for both the production and the default environment.
JavaScriptedgio.config.js version 7
1environments:{
2// Each key is the name of an environment in the Edgecast Console
3production:{
4hostnames:[
5{
6hostname:"www.mysite.com",
7},
8{
9hostname:"eu.mysite.com",
10},
11],
12// Origin configurations can also be defined within an environment-specific configuration.
13origins:[
14{
15...
16}
17],
18},
19default:{
20hostnames:[
21{
22hostname:"staging.www.mysite.com",
23},
24{
25hostname:"staging.eu.mysite.com",
26},
27],
28},
29},
includeNodeModules: If you previously set includeNodeModules: true, then you should define it within a serverless property:
JavaScriptedgio.config.js version 7
1serverless:{
2includeNodeModules:true,
3},
includeFiles: If you previously set includeFiles, then you should define it within a serverless property:
JavaScriptedgio.config.js version 6 and earlier
1includeFiles:{
2'lang/**/*':true,
3 ‘public/**/*’:true
4}
JavaScriptedgio.config.js version 7
1serverless:{
2include:['lang/**/*','public/**/*'];
3}
Versions 6 and earlier supports mapping an input path to a different output path. Version 7 does not support this capability. For example, the following configuration is unsupported:
Edgecast Applications version 7 introduces a new JSON syntax for defining the set of features that will be applied to a route.
For example, the following route sets a CDN caching policy:
JavaScriptedgio.config.js version 7
1newRouter().get('/',{
2caching:{
3max_age:'1d',// cache for 1 day at the edge
4},
5});
The equivalent route in version 6 and earlier is:
JavaScriptedgio.config.js version 6 and earlier
1newRouter().get('/',({cache})=>{
2cache({edge:{maxAgeSeconds:60*60*24}});
3});
In order to ease the transition to version 7, we provide limited support for legacy syntax. However, the following syntax is unsupported:
fallback(): The fallback() method, which is unsupported in version 7, executes when no other route is matched. If you are trying to proxy a request to a legacy origin, then you may do so by mapping the desired hostname to an origin configuration through the default_origin_name property.
JavaScriptedgio.config.js version 7
1environments:{
2// Each key is the name of an environment in the Edgecast Console
3production:{
4hostnames:[
5{
6hostname:"www.mysite.com",
7},
8{
9hostname:"random.mysite.com",
10default_origin_name:"legacy",
11},
12],
13// Origin configurations can also be defined within an environment-specific configuration.
14origins:[
15{
16name:'legacy',
17...
18}
19],
20},
21default:{
22hostnames:[
23{
24hostname:"staging.www.mysite.com",
25},
26{
27hostname:"staging.eu.mysite.com",
28default_origin_name:"legacy",
29},
30],
31origins:[
32{
33name:'legacy',
34...
35}
36],
37},
38},
You may also manually assign an origin configuration within a route through set_origin. If you want this route to act as a catch-all, then we recommend that you position it above your other routes.
JavaScript
1router.get('/',{
2origin:{
3set_origin:'myorigin',
4},
5});
destination(): The destination() method is unsupported in version 7. However, you may assign an origin to requests through set_origin and redirect requests through url_redirect. Additionally, you may use Experimentation to distribute traffic to different destinations.
ResponseWriter Methods: The following ResponseWriter methods are not fully supported in version 7:
Customize the cache key through cache_key instead of CustomCacheKey. However, if you require additional flexiblity when defining the cache key, then you may use cache_key_rewrite instead.
There are some subtle differences in our device classification implementation.
Method (Version 6 and Earlier)
Variable (Version 7)
addIsBot
Use %{wurfl_vcap_is_robot} instead. This variable returns true | false instead of 0 | 1.
addVendor
Use %{wurfl_vcap_is_ios} and %{wurfl_vcap_is_android} instead. This variable returns true | false instead of apple | android | generic.
addBrowser
Use %{wurfl_cap_mobile_browser} instead.
addDevice
Use %{wurfl_vcap_is_smartphone} and %{wurfl_cap_is_tablet} instead. These variables return true | false instead of 0 | 1.
Edgecast Applications version 6 and earlier returns an immediate response upon encountering one of the following methods:
proxy
renderWithApp
serveStatic
dir
static
send
compute
redirect
appShell
serviceWorker
render
In version 7, all routes that match the request are executed. This may cause unexpected behavior when multiple routes provide conflicting instructions.
We will now examine how the following routes are handled by different versions of Edgecast Applications.
JavaScriptroutes.js
1newRouter()
2.get(‘/’,({ proxy })=>proxy(‘web’))
3.get(‘/:path*’,({ proxy })=>proxy(‘legacy’))
Version 6 and earlier will serve requests to / from the web origin. The second route will not take effect because the request satisfied the first proxy method. Version 7, on the other hand, matches both routes for requests to /. The first route sets the origin to web, while the second route immediately overrides the first route and sets the origin to legacy. As a result, all requests will be sent to the legacy origin.
Therefore, the origin in which routes are defined is important. We recommend placing routes with general criteria before routes with more detailed criteria.
For example, reversing the order of the routes ensures that requests to / are served from the web origin.
There are a variety of methods through which you may set up redirects. One method involves uploading CSV file(s) from within the Edgecast Console. The format for this CSV file does not vary by version of Edgecast Applications. This means that you may safely import CSV files exported from a previous version of Edgecast Applications.
Edgecast Applications version 6 and earlier adds the following device classification headers to all requests sent to the origin:
x-0-device
x-0-device-is-bot
x-0-vendor
x-0-browser
In version 7, device classification headers are not included by default. However, you may define them through HTTP variables as demonstrated below.
Header (Version 6 and Earlier)
Variable (Version 7)
x-0-device-is-bot
Use %{wurfl_vcap_is_robot} instead. This variable returns true | false instead of 0 | 1.
x-0-vendor
Use %{wurfl_vcap_is_ios} and %{wurfl_vcap_is_android} instead. These variables return true | false instead of apple | android | generic.
x-0-browser
Use %{wurfl_cap_mobile_browser} instead.
x-0-device
Use %{wurfl_vcap_is_smartphone} and %{wurfl_cap_is_tablet} instead. These variables return true | false instead of smartphone | tablet | mobile | desktop.
Edgecast Applications version 6 and adds the following headers with each response:
Header (Version 6 and Earlier)
Header (Version 7)
x-0-caching-status
View additional information about the cache policy applied to the requested content through debug cache response headers. Information on how to enable debug cache response headers is provided below.
x-0-components
No equivalent header.
x-0-status
x-edg-status
x-0-t
x-edg-t
x-0-version
x-edg-version
To enable debug cache response headers
Add a route that enables debug cache response headers. A sample route is provided below.
JavaScriptroutes.js
1newRouter().match('/:path',{
2headers:{
3debug_header:true,
4},
5});
Send the following header with each request:
x-ec-debug:x-ec-cache,x-ec-cache-remote,x-ec-check-cacheable,x-ec-cache-key,x-ec-cache-state
Update all opt.moovweb.net URLs to point directly to the image. Apply the same set of query string parameters, with the exception of img, to each new URL.
Example: Convert the following sample URL from:
https://opt.moovweb.net?quality=30&width=100&img=https://edgio-community-examples-v7-image-optimization-live.glb.edgio.link/images/demo.jpg
If you are tracking Core Web Vitals through RUM, then you will need to update the initEdgioRum script to use your version 7 token. Your version 7 token is provided on the Core Web Vitals page.
Build each of your Edgecast properties by running the following command in its root directory:
Bash
1edgio build
If you encounter a build issue as a result of upgrading Node.js, then you should perform one or more of the following troubleshooting steps:
Check whether you have defined a different Node.js or npm version in either a npm config file (.npmrc) or within package.json. If so, update it to the correct version and then run edgio build to rebuild your Edgecast property.
Run node --version to check the Node.js version that you are currently using. This command should return 16.x.x (e.g., 16.18.0). Use this version information when updating .npmrc or package.json.
Clear node_modules and rebundle your project by running the following command:
Bash
1npm ci
Run edgio build to rebuild your Edgecast property.
Regenerate a new dependency tree by running the following command:
Bash
1npm i --package-lock-only
Run edgio build to rebuild your Edgecast property.
Edgecast Applications version 7 uses a different set of IP blocks than previous versions. This means that you need to update your firewall to allow:
API Domain: You must allow traffic from the following domain: api.edgecast.app. If you plan on deploying to a development or CI/CD environment, then you will also need to allow this domain for the firewall for those environments.
IP Blocks: You must allow traffic from Edgecast IP blocks if you plan on using origin configuration(s) (aka backends).
View our IP blocks by clicking Instructions from the Origins page.
If you are an enterprise customer and have not already reached out to your account manager to upgrade your organization, please do so before serving traffic through Edgecast Applications version 7. You may contact our sales department at 1 (866) 200 - 5463.
Once you are ready to serve traffic through Edgecast, you will need to update the DNS for each of your hostname(s). Specifically, version 7 requires a CNAME record that points to a service domain that is either specific to your property’s:
Edgecast Applications version 6 does not support JWT access control. Previous versions allowed you to configure on a per route basis whether requests would be allowed or denied according to a JWT token.
Edgecast Applications version 5.1+ automatically adds the x-robots-tag: noindex, nofollow header all responses being served from edge links and permalinks. This prevents search engines from indexing those links. By default, this header will not be added to any responses served from a custom domain. Prior to version 5.1, the .noIndexPermalink() function was an opt-in solution to achieve the same effect.
As a result, the .noIndexPermalink() router function is now deprecated and serves no purpose. We recommend that you remove this function from your routes.[js|ts] file.
However, if you want to override this default behavior and allow search engines to index all permalinks, you can pass the option indexPermalink set to true to the Router constructor:
Edgecast ended support for caching of GraphQL operations. If your Edgecast router (routes.[js|ts]) contains usage of .graphqlOperation(...), you should remove it. Otherwise, your application will fail to build.
Review your code to see whether it generates duplicate query string parameters. If it does, update it to handle multiple query string parameters with the same name.
Edgecast Applications version 7 introduces Real-Time Log Delivery (RTLD). RTLD allows you to define the set of data that will be logged and where log data will be sent (e.g., your web server, AWS S3, or Azure Block Blob). It consists of various modules that allow you to deliver log data for CDN, WAF, Rate Limiting, Bot Manager, and Cloud Functions.
Key information:
RTLD CDN is the module that replaces access logs (version 6). Access logs are mapped to RTLD CDN log fields below.
RTLD Cloud Functions logs requests processed by Cloud Functions. This includes Edgecast Sites requests. Use this module to deliver Server Logs, including Deep Request Inspection, to the desired destination.
A blank RTLD CDN (Version 7) cell indicates that, by default, the corresponding access log cannot be mapped to a RTLD CDN log field, a request header, a response header, or a cookie. However, you may still be able to log that data by setting a response header within your code and then logging that response header.
Version 7 introduced sophisticated bot detection through Bot Manager Standard and Advanced. Manage log data for Bot Manager events through RTLD Bot.
br
The user_agent log field returns the client’s user agent. Define logic within your destination (e.g., Splunk) to translate this value to a browser name.
Version 7 does not expose the Edgecast edge compiler version.
cy
client_city
done
Version 7 does not return request completion status.
ds
Version 7 introduced Experimentation as a replacement for Traffic Splitting and A/B Testing. Experiment and bucket information is passed within the x-edg-experiments-info upstream request header. Expose this information by passing this info back to the client as a cookie or a response header and then logging that custom response header or cookie.
dv
Version 7 returns device type information through feature variables (i.e., %{wurfl_vcap_is_full_desktop}, %{wurfl_vcap_is_smartphone}, %{wurfl_cap_is_tablet}, and %{wurfl_cap_is_wireless_device}). Expose the device type by passing the desired feature variables as a cookie or a response header and then logging that custom response header or cookie.
Version 7 has not yet introduced support for static prerendering.
prod
Version 7 does not indicate whether a request was directed to the production environment. However, the last value reported by the x-edg-version response header is the environment’s system-defined ID.
psh
Version 7 does not support HTTP/2 server push.
rfr
referer
rid
uuid
s_rq
Version 7 does not return the request’s file size. However, you may log the request payload size through the Content-Length request header. Learn how to log headers and cookies.
s_rs
file_size
sc
client_region
sec
Manage threat log data for v7 Security through RTLD WAF, RTLD Rate Limiting, and RTLD Bot.
sh
The proxy_type log field returns MIDGRESS whenever we proxy requests within our network. In addition to Origin Shield requests, this may include peering requests.
ssl
scheme
Valid values are: http and https
stl
cache_status
The cache_status log field indicates cache status. The cache status codes that correspond to stale responses are TCP_EXPIRED_HIT and TCP_EXPIRED_MISS.
t
Version 7 reports time measurements through a variety of log fields (i.e., background_fill_wait_time, read_time, prewrite_time, write_time, and total_time) and the x-edg-t response header.
timestamp
timestamp
ua
user_agent
url
path
uv
Log the Vary response header sent to the client. However, this header does not affect how we split the cache in v7. Version 7 solely uses the cache key to determine how to split the cache.
v
Version 7 does not expose the Edgecast version.
vn
Version 7 provides device information through a variety of feature variables, such as %{wurfl_vcap_is_android}, %{wurfl_vcap_is_ios}, and %{wurfl_cap_device_os}. Expose device information by passing the desired feature variables as a cookie or a response header and then logging that custom response header or cookie. Learn how to log headers and cookies.
waf
Edgecast passes security status through the waf_prod_action, waf_audit_alert, waf_prod_alert, and rl_alert log fields. Manage all other threat log data through RTLD WAF, RTLD Rate Limiting, and RTLD Bot.
wafv
Manage threat log data for v7 Security through RTLD WAF, RTLD Rate Limiting, and RTLD Bot.
Version 7 does not support the x-0-user-t response header.
zip
Version 7 does not indicate whether the response was compressed. However, you may log the Content-Encoding response header. This header indicates the type of compression applied to the response payload. Learn how to log headers and cookies.
Edgecast Applications version 7 no longer supports generic Incremental Static Regeneration (ISR) through the means of the serveStatic(...) router method. If you are using ISR with a Next.js or Nuxt application, your application will continue to work as expected.
Honors cache instructions provided by an origin server.
Caches eligible requests after a POP receives 2 requests for the same content. The following content types are exempt from this policy and are eligible for caching after a single request:
Edgecast Applications version 7 has stricter requirements for edge server compression.
Compression must be explicitly enabled for each desired content type through the compress_content_types feature.
Compression requires a cached version of the requested content.
The requested content must be greater than 128 bytes and less than 3 MB.
In addition to Brotli and Gzip compression, Edgecast Applications version 7 supports deflate and bzip2 compression. Additionally, version 7 supports transcoding compressed content when the user agent (e.g., a web browser) requests a compression method that has not been previously cached.
Edgecast Applications version 7 introduces support for communicating with clients through HTTP/3. This requires signalling HTTP/3 support to the client through the alt-svc response header.