Skip to content

Rust Starter Kit for Fastly Compute with advanced caching features

License

Notifications You must be signed in to change notification settings

fastly/compute-starter-kit-rust-advanced-caching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Caching Starter Kit for Rust

Deploy to Fastly

Get to know advanced caching with Fastly Compute with a starter kit.

For more details about this and other starter kits for Compute, see the Fastly Documentation Hub.

What's this?

As of version 0.11.0 of the Fastly Compute SDK for Rust, it is now possible to apply advanced caching techniques while accessing the Fastly readthrough cache.

  • Modifying a request as it is forwarded to a backend
  • Controlling cache behavior based on backend response
  • Manipulating the response body that is stored to the cache

This starter kit gives you a starting point for calling these extension points, enabling you to understand and customize powerful caching behavior with Fastly Compute.

Note

The advanced caching features whose uses are illustrated in this starter kit are not currently supported in Fastly's local development server. Attempting to run this starter kit in the local development server may result in the following error:

HTTP caching API is not enabled.

Understanding the code

Because advanced caching requirements vary significantly between applications, this starter kit is not designed to be deployed and run directly out of the box, unlike most Fastly Compute starter kits. Rather, it is a starting point for a Fastly Compute application code that shows how to set up the advanced caching features of the readthrough cache:

Since the code of this starter kit works with the Fastly readthrough cache, it expects a configured backend named "origin" that points to an origin server. For example, if the server is available at domain example.com, then you'll need to create a backend on your Compute service named "origin" with the destination host set to example.com and port 443. Also set Override Host to the same host value.

For details on advanced caching, see Customizing cache interaction with the backend in the developer documentation.

Security issues

Please see SECURITY.md for guidance on reporting security-related issues.

About

Rust Starter Kit for Fastly Compute with advanced caching features

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages