This is a design/architecture best practice question.
I've been asked to put a CDN in front of an API Gateway. I am very new to CDN.
Provide Cache instructions within responses and instruct the CDN on caching.
From my perspective I have two options.
My api gateway supports header injection policies. Add the cache control policies here by configuration by the developer based on what they know about how their api works.
Ask every single app behind the gateway to implement add their cache control headers.
I'm looking for opinions on how best to implement these requirements given the options above.
My initial thoughts is that the cache control might be best managed at the gateway by configuration. i.e. During CD process the developer configures an api policies configuration file to be deployed based on what they know about how their api works.
thanks