Select Language:
If you’re using Azure Front Door and want to modify response headers, such as setting the Access-Control-Allow-Origin header for CORS, you might wonder how this affects caching. Here’s a simple explanation of what happens:
When a user makes the first request to your website through Azure Front Door, the request lands at an edge location. If there’s no cached response yet, this location forwards the request to your origin server, like your storage account or web server. When the response comes back, the rules engine checks if any conditions are met — for example, if the origin header matches your setup. If it does, it adds the Access-Control-Allow-Origin header to the response.
At this point, because the response has been processed and headers added at the edge, this response gets stored in cache. So, for subsequent requests from the same user or similar requests, Azure Front Door will serve the cached response, including the CORS header, without needing to contact the origin again.
In short, the final response that includes the Access-Control-Allow-Origin header does get cached at the edge. This helps improve performance and reduces load on your origin server, as cached responses can be served quickly to future requests with the same conditions.
If you’re trying to troubleshoot or optimize this setup, consider whether you’ve configured your rules correctly. Also, check if you’re seeing unexpected behavior, like headers missing or caches not updating as expected.
For more detail, you can review how to set up rules engine header actions, understand Azure Front Door caching, and learn how to configure caching properly through these resources:
Let me know if this information helps or if you need further assistance. If this solution works for you, please consider accepting the answer and giving it an upvote. If you have more questions, feel free to comment!





