Can I use Fastly as a cache for a 3rd party API?
Can Fastly be used as a cache/CDN for a 3rd party API? A mobile app will consume data from https://thirdparty.com/api. I'd like to route that traffic through to Fastly, let's call it https://myfastlyurl.com/api. If the data is cached, return it from Fastly. If it is not cached, fetch it from https://thirdparty.com/api. I'd like to do this without standing up my own server.
And then I'd also like to implement https://myfastlyurl.com/myapi to hit my server when necessary. Is that all possible?
-
Hi,
You can use any domain or service as a backend in Fastly as long as that service doesn't have measures in place to prevent it from being used as a backend in a Fastly service. By default, we'll cache your requests based on the host and URL used for the request. That means that requests for https://myfastlyur.com/api would get cached and served by Fastly. If a request is not in cache either because it wasn't previously cached or because it's ttl expired, we would go back to the backend (thirdparty.com) to fulfill the request and cache the request (if cacheable).
Please sign in to leave a comment.
Comments
2 comments