- About the web interface controls
- Always-on DDoS mitigation
- Browser recommendations when using the Fastly web interface
- Content and its delivery
- Fastly POP locations
- Getting started with Fastly
- How caching and CDNs work
- How Fastly's CDN Service works
- HTTP status codes cached by default
- Self-provisioned Fastly services
- Sign up and create your first service
- Working with services
Domains & Origins
Domains & Origins
- Changing origins based on user location
- Connecting to origins
- Enabling global POPs
- Failover configuration
- IPv6 support
- Maintaining separate HTTP and HTTPS requests to origin servers
- Routing assets to different origins
- Setting up redundant origin servers
- Specifying an override host
- Using Fastly with apex domains
- About Dynamic Servers
- Authenticating URL purge requests via API
- Cache control tutorial
- Caching configuration best practices
- Controlling caching
- Creating and using pools with Dynamic Servers
- Creating and using server entries with Dynamic Servers
- Enabling API caching
- Enabling automatic gzipping
- Failure modes with large files
- Getting started with surrogate keys
- HTTP/2 server push
- Implementing API cache control
- Large File Support
- Logging purge requests
- Making query strings agnostic
- Purging API cache with surrogate keys
- Request collapsing
- Serving stale content
- Setting Surrogate-Key headers based on a URL
- Setting Surrogate-Key headers for Amazon S3 origins
- Single purges
- Soft purges
- Streaming Miss
- Wildcard purges
- Accept-Language header VCL features
- Authenticating before returning a request
- Basic authentication
- Creating location-based tagging
- Custom responses that don't hit origin servers
- Delivering different content to different devices
- Enabling URL token validation
- Guide to VCL
- Isolating header values without regular expressions
- Manipulating the cache key
- IP geolocation variables: Migrating to the new dataset
- Overriding which IP address the geolocation features use
- Response Cookie handling
- Support for the Edge-Control header
- Understanding the different PASS action behaviors
- Using edge side includes (ESI)
- VCL regular expression cheat sheet
Access Control Lists
Monitoring and testing
Web Application Firewall
- Log streaming: Amazon S3
- Log streaming: Microsoft Azure Blob Storage
- Log streaming: Cloud Files
- Log streaming: Datadog
- Log streaming: DigitalOcean Spaces
- Log streaming: FTP
- Log streaming: Google BigQuery
- Log streaming: Google Cloud Storage
- Log streaming: Honeycomb
- Log streaming: Kafka
- Log streaming: Log Shuttle
- Log streaming: LogDNA
- Log streaming: Logentries
- Log streaming: Loggly
- Log streaming: Heroku's Logplex
- Log streaming: OpenStack
- Log streaming: Papertrail
- Log streaming: Scalyr
- Log streaming: SFTP
- Log streaming: Splunk
- Log streaming: Sumo Logic
- Log streaming: Syslog
User access and control
Last updated August 09, 2018
How long Fastly caches content
The maximum amount of time we cache content depends on a number of factors including the TTL (Time To Live) and Grace Period, how often an object gets accessed, and how busy other customers are. Setting TTL and Grace Period to a week, possibly even two weeks should be absolutely fine. For more information about controlling how long Fastly caches your resources, start with our Cache Control Tutorial. In general, we will honor any cache-control headers you send to us from your origin.
You can determine what your default TTL for your service will be as follows:
- If you haven't set the
Cache-Control: max-age, or
Expiresheaders, the TTL is 120 seconds
- If you've set those headers and haven't specified the TTL in the web interface or custom VCL, the TTL is 3600 seconds
- If you've specified the TTL in the web interface or custom VCL, the TTL is whatever you specified
You can change this limit on the Configuration page.
Changing caching times for different users
You can change the caching times for different users through Surrogate-Control headers defined by the W3C. If, for example, you wanted Fastly to cache something for a month (clearing with API purges, if necessary) but you also wanted to set a maximum age of a single day for users viewing that object in a browser, then you could return the HTTP header:
1 2 Surrogate-Control: max-age=2629744 Cache-Control: max-age=86400
The Surrogate-Control header in this example tells Fastly to cache the object for a maximum of 2629744 seconds (one month). The Cache Control header in this example tells the browser to cache the object for a maximum of 86400 seconds (1 day).
For Surrogate-Control, Fastly supports the
For more information about controlling caching, see our Cache Control Tutorial.
Conditionally preventing pages from caching
To conditionally prevent pages from caching, follow the steps below.
- Log in to the Fastly web interface and click the Configure link.
- From the service menu, select the appropriate service.
- Click the Configuration button and then select Clone active. The Domains page appears.
- Click the Settings link. The Settings page appears.
Click the Create cache setting button to create a new cache setting. The Create a cache setting page appears.
- Create a new cache setting and then click the Create button. The new cache setting you created appears on the Settings page.
Click the Attach a condition link to the right of the newly created cache setting. The Create a new cache condition window appears.
- Create a condition that matches the URLs you want and then click the Save and apply to button.
In this example, we set the condition to look for URLs containing
/assets. If the condition finds them, the URLs should be cached. If the condition doesn't find them, the URLs are explicitly not cached by the apply if statement shown above.
- Click the Activate button to deploy your configuration changes.
TIP: You can use these steps to override default caching based on a backend response.
Caching action descriptions
You can use actions to tell Fastly what to do with cached objects and what to do with additional cache configurations as a result. The following actions are available:
- Do nothing now - Only set the TTL or stale TTL.
- Deliver - Deliver the object to the client. Usually returned from
- Pass - Pass the request and subsequent response to and from the origin server without caching the object. Usually returned from
- Restart - Restart the request processing for the object. You can restart the processing of the whole transaction. Changes to the
reqobject are retained.