Urgent.News

What's breaking now, across thousands of outlets.

Tech

Fastly Surrogate Keys: A Better Way to Purge API Caches

Fastly's edge caching with Surrogate-Key headers allows for fine-grained purging, enabling you to cache aggressively and invalidate only what changed.

Fastly Surrogate Keys: A Better Way to Purge API Caches

Caching API responses at the edge is appealing until the issue of invalidating cache becomes problematic. Balancing between caching aggressively and purging selectively is crucial. Fastly provides a solution to this challenge. By creating a Fastly service and pointing it to your API as the origin, you can manage caching effectively.

Surrogate-Key header is introduced, allowing API responses to be tagged with one or more keys. This tagging enables Fastly to index the cached object under all keys, offering fine-grained purging controls. When data changes, only the relevant keys need to be purged, leading to targeted cache invalidation. While other AWS services like CloudFront and API Gateway also offer caching capabilities, they lack the surrogating key functionality and key-based purging, which restricts their ability to provide precise, event-driven invalidation.

Fastly on the other hand, provides a free tier, enabling users to set up multiple projects without incurring costs. The key to edge caching success is fine-grained purging, which ensures data remains fast and fresh.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in Tech

Pudu Programming Language

Pudu is a statically typed, expression-oriented programming language that I’m designing for building services, developer tools, and native applications.

  • Pudu is a new programming language for services, tools, and apps
  • Focuses on making errors and absent values visible through syntax
  • Uses expression-oriented design for easier code composition and reasoning

I Built a Football Data Analysis Pipeline From 220,000 Matches

For academic research only. Not betting advice. GitHub : MENG-COOLMAN/PitchQuant — MIT license, free to use. The TL;DR Six months. 227,000 matches.

  • Researcher analyzed 227,000 football matches to find hidden insights in odds
  • Weak-consensus trap: favorite wins 36-43% of the time when market is not strongly convinced
  • Deceptive low odds: Home odds below 1.30 may reduce actual home wins significantly

More from Saturday 19 September →