Enabling compression via ruleset

Stan-7493 86 Reputation points


I was wondering if there was a way to enable compression by content-type via Rulesets?

The scenario is that I have disabled caching on frontdoor and enabled caching only on specific Paths via rulesets. I was wondering if we can enable compression via rulesets but with the condition being by content type? Or if there is any other suggestions on how to do so it would be much appreciated.

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

Accepted answer
  1. GitaraniSharma-MSFT 48,531 Reputation points Microsoft Employee

    Hello @Stan-7493 ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know if it is possible to enable compression on Azure Front Door via ruleset if you've disabled caching on Front Door and enabled caching only on specific paths via rulesets.

    As documented in the Azure Front Door Compression doc,

    In Azure Front Door, compression is part of Enable Caching in Route. Only when you Enable Caching, can you take advantage of compression in Azure Front Door.

    And, if you look at the rule set actions of Azure Front Door,

    The route configuration override action is used to override the origin group or the caching configuration for the request. You can choose to override or honor the origin group configurations specified in the route. However, when you override the route configuration, you must configure caching. Otherwise, caching gets disabled for the request.

    So, could you please try to configure a route configuration override for the specific requests where you want to enable compression and let me know if it works?

    User's image

    There is no match condition as "custom file type" in the Azure Front Door ruleset. Like you mentioned above, you will have to use a match condition with Request file extension and then add an action to either disable caching or override route configuration to disable compression.

    And the only way to validate if the request is being compressed is to check the response header for the Content-Encoding.

    Refer: https://learn.microsoft.com/en-us/azure/frontdoor/standard-premium/troubleshoot-compression

    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

0 additional answers

Sort by: Most helpful