Because Fastly is built on Varnish, we can use Varnish Configuration Language (VCL) to perform intelligent caching and push application logic to the edge. VCL allows you to control most aspects of an HTTP request or response, including where content is fetched from, what’s cached, and how it’s cached and served. Our powerful user interface and configuration API auto generate VCL for you. You can also write your own Custom VCL, upload it alongside Fastly VCL, and activate instantly. Our Support Plans and Professional Services Packages provide configuration assistance with more complex setups.
Fastly’s Edge Modules allow you to use VCL to perform custom logic at the edge, closer to your customers. This gives you the power to tailor how content is served, ensuring the best possible user experience.
- Edge Authorization / Paywalls authorize requests faster by placing access at the edge rather than sending requests to your origin and back again.
- GeoIP / Location Detection identifies where customer requests are coming from, so you can offer customized experiences based on location. For example, you can create a virtual boundary (geo-fencing) and send customers within that boundary localized content such as coupons or special offers.
- Mobile Device Detection helps you determine what device a customer is using, and allows you to serve content accordingly — e.g. for iPhone users, you can serve smaller, high-resolution images.
- Visitor Prioritization gives priority to active buyers if your site becomes overloaded during peak traffic events, directing casual shoppers to a waiting room.
- Edge Side Include (ESI) is a Varnish feature which accelerates site performance by allowing you to mix both cacheable and uncacheable content. Fastly serves cacheable content and send requests for uncacheable content — such as the shopping cart — back to origin.
Edge Dictionaries give you greater flexibility and control at the network edge, letting you make real-time decisions from every server in the Fastly network. Dictionaries are key-value pairs that your VCL can reference inside your Fastly service (think of it as a database at the edge). Using an API call, you can add to or update data inside an Edge Dictionary anytime, without having to deploy a new version of your service configuration. Edge Dictionaries enable content sharing and social media outlets to update large referrer spam blacklists in real time. Image providers can quickly perform token checks for certain objects. Adtech companies can block bad actors at the edge, while global publishers redirect users to a country site based on geo-location.