Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

set-fastly-surrogate-key.js 620 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
  1. module.exports = function setFastlySurrogateKey (req, res, next) {
  2. // Fastly provides a Soft Purge feature that allows you to mark content as outdated (stale) instead of permanently
  3. // purging and thereby deleting it from Fastly's caches. Objects invalidated with Soft Purge will be treated as
  4. // outdated (stale) while Fastly fetches a new version from origin.
  5. //
  6. // Use of a surrogate key is required for soft purging
  7. // https://docs.fastly.com/en/guides/soft-purges
  8. // https://docs.fastly.com/en/guides/getting-started-with-surrogate-keys
  9. res.set('surrogate-key', 'all-the-things')
  10. return next()
  11. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...