EdgeWorkers on GitHub
Take a deeper dive with sample EdgeWorkers use cases by checking out our GitHub repo.
EdgeWorkers provides a variety of use cases including creating new microservices, manipulating requests and responses, and managing Akamai-as-code.
Many websites use geolocation logic to improve the user experience for online visitors. Geolocation allows sites and apps to increase user engagement, reduce bounce rate, and improve conversions by delivering location-specific content to visitors such as localized site versions, nearby stores, or special products and offers.
Challenge | IP-based geolocation is often implemented as a separate HTTP request, allowing static page content to remain cacheable with client-side logic to handle the dynamic response to the user’s location. Additional HTTP requests to a geolocation service can decrease page load speed and increase visitor frustration. |
Solution | Create a geolocation service at the edge leveraging EdgeWorkers to:
|
Benefit | With a geolocation service that runs at the edge, the separate HTTP service to origin can be eliminated resulting in:
|
Learn More | https://developer.akamai.com/blog/2020/06/11/edgeworkers-use-case-fast-geolocation |
Suggesting relevant search terms while a user types in a search box is a common practice on many websites and search engines. It provides a relevant and fast response that is essential for excellent user experiences.
Challenge | Tuning autocomplete results is difficult because:
|
Solution | Create an autocomplete service at the edge leveraging EdgeWorkers to:
|
Benefit | Since the autocomplete service now runs at the edge, the separate HTTP service to origin can be eliminated resulting in:
|
Learn More | https://developer.akamai.com/blog/2020/05/15/boost-autocomplete-performance |
Traffic from search engines is critical to the success of any business. Often, the URLs from the search engines or from social media platforms include query string parameters that are used by tools like Google Analytics in order to provide insight into user behavior. This insight enables companies to determine the return on their marketing investment.
Challenge | Companies are forced to sacrifice offload and performance in order to gain valuable tracking insight. The query string parameters added by search engines and social media sites decrease offload as they are often unique values that result in the request going to origin as opposed to being served from the cache. However, companies do not want to remove these query string parameters as they allow them to use tools like Google Analytics to understand user behavior. |
Solution | Utilize EdgeWorkers to reduce latency and still maintain the ability to track analytics by:
|
Benefit | Query strings are managed and cached content is delivered at the edge for:
|
Marketing platforms provide their customers with solutions that enable them to communicate with their customers through a number of channels, including promotional emails. In order to send the end user to the right experience, marketing platforms embed contextual information in the URL path.
Challenge | Links that are embedded within promotional emails contain contextual information in the form of hashed parameters and other contextual attributes. High volumes of traffic coming from these links require processing and re-routing by the origin in order to send the end user to the right experience. This processing at origin reduces offload, increases latency, and requires sufficient origin infrastructure to handle the volume of traffic. |
Solution | Use EdgeWorkers to decode the hashed parameters that are a part of the URL and establishes where to route the user in order to:
|
Benefit | Since the URL Decoding service now runs at the edge, the separate http service to origin can be eliminated resulting in:
|
Companies want to deliver the right experience for real users and automated bots, including blocking, redirects, and constructed responses based on conditional logic. For example, a company may want to present an optimized view to an SEO bot and filter a bad bot from reaching their origin.
Challenge | Allowlists and blocklists are created in order to determine the type of experience to provide to different incoming requests. These lists and the logic that determines the right action sit at origin. This results in:
|
Solution | Create a filtering service at the edge leveraging EdgeWorkers to:
|
Benefit | Since the filtering service now runs at the edge, the separate filtering service to origin can be eliminated resulting in:
|
Routing based on request characteristics allows individuals, teams, and companies to make careful changes to their user experiences while collecting data on the results. This allows them to test hypotheses to learn how certain elements of their experiences impact user behavior.
Challenge | Experimental decision logic is typically implemented as a service at the origin, which requires a trip to origin in order to make the A/B decisions for which piece of content to serve to the end user. This results in reduced offload and added latency to the end user request. |
Solution | Determine the content to serve based on the category that the inbound request resides by leveraging EdgeWorkers to:
|
Benefit | The decision on the content to serve to a user segment is written at the edge as opposed to the origin, resulting in:
|
Learn More | https://github.com/akamai/edgeworkers-examples/tree/master/a-b-test https://github.com/akamai/edgeworkers-examples/tree/master/multivariate-test |
Companies are looking to deliver best-in-class, personalized digital experiences without sacrificing the core principles of performance and offload. By breaking a website into its cacheable micro-components, companies are able to deliver exceptional digital experiences while maintaining high offload and strong end user performance.
Challenge | Delivering a customized digital experience results in having to sacrifice performance and offload. Every end user cohort receives a different experience, which lowers cacheability of content and ultimately negatively impacts end user performance. |
Solution | Leverage EdgeWorkers to compose the response at the edge from page templates or fragments pushed from a CMS and stored in a database to:
|
Benefit | Response is composed of mostly cacheable fragments, as opposed to constructing a customized response at origin, resulting in:
|
Companies are looking to deliver personalized experiences to end users without sacrificing the core principles of performance and offload. Personalized experiences increase user engagement and drive business metrics.
Challenge | Personalization decisions, specifically identifying the user and determining the personalized content that should be presented to this user, typically reside at the origin. This means that personalized content is typically uncacheable, resulting in low offload and negative impact to end user performance. |
Solution | Leverage EdgeWorkers to detect characteristics of inbound requests to uniquely identify users and retrieve personalized content to present to the user with:
|
Benefit | Personalized content is retrieved from the edge, as opposed to the origin, resulting in:
|
Sites and applications rely on headers and cookies to deliver elite user experiences. As more and more data is tracked, the size of response headers increases and can eventually exceed limits, resulting in page errors — and frustrated customers.
Challenge | The size of the response with header data can eventually hit a limit, resulting in page errors for users. |
Solution | Leverage EdgeWorkers to implement JavaScript logic to determine cookie lengths and remove unnecessary data to:
|
Benefit | EdgeWorkers allows developers to easily manage response sizes and eliminate unnecessary data to:
|
Many web experiences require a request to be authenticated in order to return data. Reasons for this include presenting information behind a login for registered users or presenting information only if a user has an active subscription.
Challenge | The logic to authenticate requests typically resides at the origin (via logic that was custom built or via a 3rd party tool like an API gateway). The logic residing at the origin results in the following challenges:
|
Solution | Use EdgeWorkers to implement JavaScript logic to determine if a request is authenticated:
|
Benefit | By performing request authentication using EdgeWorkers at the Akamai Edge, customers are able to:
|
Developers are often asked to implement logic to support marketing campaigns to their web properties, including traffic management routed to origin for content delivery or appropriate tagging by back-end systems. Placing the logic that governs marketing campaigns at the edge results in faster page performance and decreased traffic to origin.
Challenge | The logic to track marketing campaigns or promotions is often done at origin. This results in the following challenges:
|
Solution | EdgeWorkers can implement much of this logic at the edge instead of making a long, latent trip to origin. |
Benefit | Decreased page load time and reduced load on origin infrastructure yields a better user experience. |
Online video providers often deposit the logic that governs content delivery on the client side. Not only is this not optimal for customer experiences, it creates challenges for scaling and personalization. Managing dynamic delivery with EdgeWorkers opens up a new arena of customizable and fast-to-market experiences.
Challenge | The logic to track marketing campaigns or promotions is often done at origin. This results in the following challenges:
|
Solution | Leverage EdgeWorkers to implement dynamic logic at the edge to:
|
Benefit | Utilizing manifest manipulation at the edge enables personalization, content security, and ad-insertion at greater scale than can be achieved using a client-side approach. Using a widely distributed network can reach large audiences with customized manifests across the landscape of devices and browsers without concerns around player updates and heavy reliance on third-party software. |
Learn how serverless computing with Akamai can improve your web and app performance and support agile development processes.