Knowledge-packed presentation for .NET users group in Bydgoszcz, Poland (BUG.NET) about Fastly edge computing. Focused on CDN and other case study in couponfollow.com context.
Why Teams call analytics are critical to your entire business
Deep dive into Fastly
1. Deep dive into Fastly
Piotr Benetkiewicz
piotr@couponfollow.com
2. What is
Edge computing provider:
● CDN
● Varnish implementation
● Image Optimization
● ESI
● WAF
● and more
3. What is
● Founded in 2010, self-funded and profitable
● We help shoppers save money through best coupons, deals discovery and cashback
● Our two primary products are CouponFollow and Cently
● We are a global, remote team of close to 50 engineers
● We support learning culture and follow the DevOps way
● Currently looking for a Technical Product Manager for our Coupons platform team
4. Who am I
● Coding in .NET for 16 years
● Climber
● Lego collector
● F1 fan
5. Caching basics
● Cache Key: Host + URL
● Pages setting cookies are not cached
● TTL: 3600s by default
Cache control
● Fastly UI
● Varnish snippets
● Headers
6. Cashing basics cont.
● Surrogate-Control
● Vary Scenarios
○ Desktop vs. Mobile
○ Compression: Brotli, gzip, deflate…
○ Experiments, A/B tests
● Things to consider
○ Normalization of UA
○ Fastly supporting API
Vary: User-Agent
7. Stale content
Fresh (300s)
Serving content from cache
Stale (30s)
Serving stale content up to 30s while fetching fresh content from the origin
Error (86400s)
Serving stale content up to 24h if backend responds with 500
Cache-Control: max-age=300, stale-while-revalidate=30, stale-if-error=86400
8. VCL and CoE
● Implementation of Varnish Configuration Language
○ Abstraction over request->response processing
○ Additional APIs: client.platform, client.geo, etc.
● ACL
● Edge dictionaries
10. Image optimization
● Image transformation on edge
● Requires additional setup and support ticket
● https://io.tacolabs.com/assets/beef-soft-tacos.jpg?width
=250&quality=90
11. ESI
● Edge Side Includes
● W3C
○ compose from fragments
○ cacheability separately associated
<esi:include src="https://couponfollow.com/esi/foo" />
12. Any Questions?
Let us know if you have any questions!
Piotr Benetkiewicz
piotr@couponfollow.com