Nic Acton
  • My Gitbook
  • My Favorite Things
    • Podcasts
    • Newsletters
  • Monthly Summaries
    • May 2019
    • June 2019
  • Cloud Computing
    • Cloud Concepts
    • AWS
      • Certified Solutions Architect
      • Well Architected Framework
        • Operational Excellence
        • Reliability
        • Performance Efficiency
        • Cost Optimization
        • Security
      • Analytics
        • Elasticsearch Service
        • Kinesis
        • Elastic MapReduce (EMR)
      • Compute Services
        • Elastic Beanstalk
        • Elastic Container Service (ECS)
      • Deployment
        • CloudFormation
      • Application Services
        • Key Management Service (KMS)
        • Simple Queue Service (SQS)
        • API Gateway
        • Simple Work Flow (SWF)
        • Amazon MQ
        • Simple Notification Service (SNS)
      • Simple Storage Service (S3)
        • Macie
      • Databases
        • RDS
        • DynamoDB
        • ElastiCache
        • Neptune
        • Redshift
      • Cloudfront
      • IAM
      • Monitoring
        • Trusted Advisor
        • Amazon Inspector
        • AWS Config
        • AWS Shield
        • CloudWatch
          • VPC Flow Logs
        • CloudTrail
        • Guard Duty
      • Route53
      • Serverless Architectures
        • Lambda
      • VPC
        • Highly Available & Fault Tolerant VPCs
        • Hybrid Environments
          • VPC Peering
          • Direct Connect
        • Cloud HSM
    • GCP
    • Azure
    • HashiCorp
    • Red Hat
      • RHEL
        • Basics
        • Grep & Regex
        • SSH
      • Ansible
    • Tutorials/Guides
      • Linux
        • Admin
  • Software Engineering
    • Machine Learning
      • Deep Learning
        • Tensorflow
      • Training and Loss
    • Programming
      • APIs
    • Security
    • Web Development
      • OSI 7 Layer Model
    • Tutorials/Guides
      • Apache Server
    • Virtualization
      • Virtual Machines
      • Containers
      • Serverless
  • Fitness
    • Nutrition
      • Diets
      • Macronutrients
      • Supplements
      • Miscellaneous
    • Strength Training
    • BodyBuilding
  • Miscellaneous
    • Technology Ethics
      • Education
    • Interesting Concepts
      • Libertarian Paternalism
Powered by GitBook
On this page
  • Cloudfront Origins
  • Essentials
  • Updating Cached Files
  • Security
  • Performance

Was this helpful?

  1. Cloud Computing
  2. AWS

Cloudfront

AWS content delivery network (CDN)

Edge Locations

Over 100 AWS data centers geographically distributed across the globe, with the following services offered and synced through ALL OF THEM: Route53, Cloudfront, WAF, Shield and Lambda@Edge

Cloudfront Origins

  • Source of content (static and dynamic)

  • Can be an:

    • S3 bucket

    • ELB

    • Any public HTTP endpoint (web distribution)

  • Live Video Streaming and VOD

  • RTMP Distribution (Flash Media Files)

Essentials

  • Global CDN which delivers content to users from the nearest edge location.

  • Retrieves content from origins

  • Distributions (web or RTMP)

    • Define origins for content (static and dynamic)

    • Integrate with Route53 for alternate CNAMEs

      • Allows you to create a URL like cdn.nicacton.com that works with a distribution

    • Cache behaviors

      • PATH pattern (images*.jpg)

      • Min, Max, Default TTL

      • Query String forwarding and caching

      • HTTP Methods (GET, POST, PUT, HEAD, etc...)

Updating Cached Files

  • Caching is done based off the cache key.

  • In order to serve a new version of an object, either create a new object with a new name or create an "invalidation" on the Cloudfront distribution based off the object name.

  • "Invalidations" can be costly

  • Set TTL=0

Security

  • SSL Certificates can be used

  • End-to-end HTTPs

  • AWS WAF Integration

  • Distribute Private Content

    • S3

      • Limit access to Origin Access Identity (OAI)

        • Modified in Bucket policy

    • Signed URL or Signed Cookie

      • Expiration

      • Restrict by IP

      • Trusted Signers (Cloudfront Key Pairs)

  • Geo Restriction

Performance

  • Regional Caches

    • Save content ejected from cache close to Edge location

  • Point entire domain to Cloudfront to speed up dynamic content

    • Content optimizations

    • Dynamic objects are still cached

  • CloudFront performance can be affected by:

    • File size and type of file

    • Having to remake the request from the Edge location to the origin.

      • Downloading the object from origin takes time.

      • As well writing it to cache and responding to the end user request.

      • The more requests that have to go to the origin, the higher the load is on your source. Which can also cause latency and load performance issues.

    • Query strings (request to the origin to serve a specific object) reduce cache "hits":

      • cdn.nicacton.com/?querythis=querythat

      • Reduces performance because query strings are often unique so it reduces the cache hits and require "work" to forward to the origin location.

  • Cloudfront Performance increased by:

    • Longer cache periods increase performance (less frequent request to the source).

PreviousRedshiftNextIAM

Last updated 6 years ago

Was this helpful?