In our environment, authors will publish several times on specific pages like test1, test2, and test3 during day time. To validate those changes in site1.com, they have to wait for one hour to clear the cache as per our Current TTL time.
So, We want to integrate this clear cache process in the workflow, so we don't need to rely on TTL time.
Is it possible for us to clear the cache of each path in Cloud Front instead of the entire project, and Is it possible to connect the Cloud Front console from the code?
If we have access to the CloudFront from the code, we can take the payload from the workflow, append site1.com( for prod) and send the complete URL to the console to clear the cache.
Ex: payload - /content/site1/test
if it is prod we will append site1.com to it - https://www.site1.com/test
stage - https://uat.site1.com/test
Note: I know we have to clear the dispatcher's cache before clearing the cache in CDN. I am thinking about exploring a replication agent(dispatcher-flush) in the author to invalidate the cache.
Please advise if you have any thoughts/suggestions on this process.