1

Is it possible to serve always stale/cached data from CDN edge servers like Akamai. ?

Reason is if there is some problem in origin server and It might need 2-3 days to solve it.My origin server responds properly but I don’t want it to get overloaded and want CDN to keep serving the cached data instead for sometime.

Best Regards, Saurav

saurav
  • 5,388
  • 10
  • 56
  • 101

1 Answers1

1

Yes, Akamai can serve stale content if the request to the origin times out or produces an error code. Here's a screen shot of the "Caching" and "Cache HTTP Error Responses" behaviors.

enter image description here

Note, however, that your content will need to be fairly popular to remain in cache. If it's not popular, then it may be evicted before you're able to repair your origin.

A better alternative is to implement a Site Failover ruleset which allows you to serve your page with alternate content from a separate origin, or static assets from Akamai's NetStorage. Here's a screenshot of a typical Match of a failed origin and the standard Fail Over behavior.

enter image description here

The "Action" field provides the following options, which can each be configured to your needs:

  1. Serve stale content
  2. Redirect to a different location
  3. Use alternate hostname in this property
  4. Use alternate hostname on provider network
  5. Serve alternate content from NetStorage
Josh Cheshire
  • 334
  • 1
  • 10
  • thanks Josh for the reply...so it means serve the content from a different location ?...my use case is to always server cached/stale data even if the origin server is up – saurav Nov 20 '19 at 07:50
  • 1
    You can configure it to always serve cached/stale data if the origin is down. You can also configure very high TTLs when the origin is up. But it's important to understand that the content will most likely not stay in cache long unless it is very popular. The better solution is to serve alternate content when the origin is down and there's a lot of flexibility with how you can handle that use case. – Josh Cheshire Nov 21 '19 at 15:03