Service Workers
Integration libraries to support a variety of edge networking and service worker providers.
Supported Providers
Spec maintains public Cloud Service Provider-specific npm packages to integrate with the Spec Platform.
If Spec doesn't support a provider you need, contact your Product Success representative.
Config
Service Workers enable seamless integration with Spec at the CDN level. Our easy-to-use libraries handle everything in the background, and integration requires just one function call, with flexible configuration options for routing traffic to the Spec Platform.
The following are the configuration options that are common to all service workers:
Key | Type | Default | Notes |
---|---|---|---|
| Boolean |
| Enable or disable Spec processing. When disabled (true), all traffic bypasses Spec and goes directly to the customer's origin, ignoring all other settings. |
| Boolean |
| Switch between two processing modes: Active Inline ( Pass Through ( |
| Number |
| The percentage of IP addresses to route through Spec; the rest go directly to the customer's origin. Useful for gradual onboarding or rollout. |
| String | none | A key from Spec to verify that traffic originates from a customer-controlled service worker. |
Why Service Workers?
Service workers process data near users, reducing latency and enhancing real-time performance while optimizing bandwidth and improving security. Spec uses edge computing to route traffic from a CDN to the Spec Trust Cloud. It can either duplicate requests to Spec while sending the original to the origin server ("pass-through" mode) or forward requests directly to Spec, who in turn forwards requests to the origin server ("active" mode).
To learn more about the HTTP library's functionality, explore the source here:
Last updated