Cloudfront



aws' scalable, fast, and flexible cdn





steve.bradford

Covering...


basic cloudfront deployments

common issues and tasks

non-streaming distributions

Deployment styles


edge cache vs. linking assets only

edge cache = very efficient, and will hold the site in cache even if the backend is down

assets only = easier to setup and use, possibly better for dynamic use

CloudFront Summary


origin pull CDN

priority traffic to aws resources

'free' storage

granular behaviors

lower bandwidth costs than ec2

Things to know for SEtup


origin (s3, ec2)

hostnames (if any)

logging bucket

price class (endpoints)

Logging


spits out in apache style logs, gzipped

drops into s3 bucket with optional prefix (folder)

eventual consistency

tons and tons of files - often 1 per client request set

recommend s3 lifecycles to prevent overgrowth

origins


multiple origins are allowed per distribution

each origin must have a unique name, and just allows for organizing of behaviors

HTTP vs HTTPS

custom ports for each

custom hostnames


up to 10 (more possible if requested)

can't be the same as the origin hostname (well, it can, but that's kind of stupid)

requires Route 53 to use, specifically an ALIAS record

use when you want to front your site rather than just use the CDN for static assets

behaviors


allows different paths to cache things different ways

very basic path patterns are allowed, with a single '*' match permitted

can force HTTP/HTTPs, object TTL, cookie, and query string options for a given path

Advanced behavior options


GET vs. other verbs (GET=faster)

query string caching (none=faster)

cookie forwarding (none=faster)

signed URLs for secure content (requires backend work to create the query string, and works by IP)

RESTRIctions


allows for whitelisting and blacklisting based on GeoIP

no additional charge, but likely additional management overhead

Invalidations


used to clear part, or all, of the cache

slow

unreliable

costs $ to perform

better to just have shorter cache TTLs, depending on the content

ERROR PAGES


allows for custom response pages to be used for most 400 and 500 error codes


vs s3


costs less as there is no storage fee, and the bandwidth is cheaper

pulled vs. managed storage = less freedom, but less management needed

cloudfront is faster

ask me stuff and i'll make up answers





go ahead



special guest star : a quick tour of a distribution
Made with Slides.com