Clean cache by Tag with Frontdoor

Clement Fayol 25 Reputation points
2023-12-06T08:26:23.2233333+00:00

Hello,

I have a NextJs application that retrieves content from a CMS Headless and a frontdoor. In my CMS Headless, I have some content that could be used on multiple pages. I want to invalidate the cache of my frontdoor but only where the content is used, not the entire cache. I can only clean the cache by Path, but I want to be able to clean the cache by a specific tag that I can add to the content used in the page. This way, the CDN can clean only the pages where the tag is found. Is there a way to do this with Frontdoor?

Alternatively, do you have any other suggestions for implementing this behavior?

Regards.

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
829 questions
{count} vote

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 49,916 Reputation points Microsoft Employee Moderator
    2023-12-11T09:42:48.7133333+00:00

    Hello @Clement Fayol ,

    I understand that you would like to know if there is a way to purge Azure Front Door cache by a specific tag that you can add to the content used in the pages, so that it only purges the pages where the tag is found.

    As of today, the only available supported formats for Azure Front Door cache purge are as below:

    • Single path purge: Purge individual assets by specifying the full path of the asset (without the protocol and domain), with the file extension, for example, /pictures/strasbourg.png;
    • Root domain purge: Purge the root of the endpoint with "/" in the path.
    • Wildcard purge: Asterisk (*) may be used as a wildcard. Purge all folders, subfolders, and files under an endpoint with /* in the path or purge all subfolders and files under a specific folder by specifying the folder followed by /*, for example, /pictures/*.

    NOTE: Currently, we don't support directly purging wildcard domains. You can purge paths from specific subdomains by specifying that specific subdomain and the purge path. For example, if my Front Door has *.contoso.com, I can purge assets of my subdomain foo.contoso.com by typing foo.contoso.com/path/*. Currently, specifying host names in the purge content path is limited to subdomains of wildcard domains, if applicable.

    Refer: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-caching?pivots=front-door-classic#cache-purge

    https://learn.microsoft.com/en-us/azure/frontdoor/standard-premium/how-to-cache-purge

    I also checked with the Azure Front Door Product Group team, and they confirmed that Azure Front Door doesn’t support cache purge by tag. However, they have taken note of this feature request and added it to their roadmap backlog for future improvements.

    If you wish you may also leave your feedback in the below forum requesting this feature. All the feedback you share in these forums will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.

    https://feedback.azure.com/d365community/forum/8ae9bf04-8326-ec11-b6e6-000d3a4f0789

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.