Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

12 replies

EstebanBustamante
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Sep 25, 2023 3:37 PM UTC

Can you elaborate on what type of compression you are referring to?

I guess you are referring to dispatcher compression, if so, you could use the DEFLATE mod, please take a look at these resources that will guide how to enable this:

 

https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html?lang=en#specifying-the-documents-to-cache
https://www.albinsblog.com/2018/09/improve-performance-of-adobe-experience.html

Translate
Esteban Bustamante
Ravi_Pampana
Community Advisor
Community Advisor
Sep 26, 2023 4:15 AM UTC

Hi,

 

By default, AEM does not compress JSON files. To enable compression for JSON you can add below in dispatcher.any file

/filter{
/0001
{
/glob "*.json"
/type "allow"
/name "Allow JSON"
/action "gzip"
}
}

After making changes to the Dispatcher configuration, restart the Apache web server to apply the new rules.

Translate
Ravi Pampana
Level 2
Sep 26, 2023 6:04 AM UTC

Hi @ravi_pampana ,

can it be applicable for AEM as Cloud Service.

Translate
kautuk_sahni
Level 9
Sep 26, 2023 11:13 AM UTC

@rajesh_didshe Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Translate
Kautuk Sahni
Level 2
Sep 27, 2023 5:39 AM UTC

Hi @kautuk_sahni ,

 

I have tried above both step as @ravi_pampana  and @estebanbustamante mentioned. Tried DEFLATE mod but it's not working and for Filter step getting build failure error on action and name. Have attached Screenshot of build error log for same.

Translate
kautuk_sahni
Level 9
Sep 28, 2023 9:40 AM UTC

To enable text compression using OSGi config and dispatcher rules for JSON files in AEM, you can follow these steps:

  1. Enable text compression in AEM.

    • Go to the AEM Configuration Manager.
    • Navigate to OSGi > Configurations > Apache Sling Dispatcher.
    • Edit the filter configuration.
    • Add the following filter rule:
    JSON
    {
        "glob": "*.json",
        "type": "allow",
        "name": "Allow JSON",
        "action": "gzip"
    }
    
    • Save the configuration.
  2. Configure the Dispatcher.

    • Edit the dispatcher.any file.
    • Add the following filter rule:
    JSON
    /filter {
        /0001 {
            /glob "*.json"
            /type "allow"
            /name "Allow JSON"
            /action "gzip"
        }
    }
    
    • Save the file.
  3. Restart the Dispatcher.

Once you have completed these steps, text compression will be enabled for JSON files in AEM.

Note: If you are using AEM as a Cloud Service, you cannot edit the dispatcher.any file directly. Instead, you must use the Dispatcher configuration UI. To do this, go to the Dispatcher section of the Cloud Manager and click Edit Configuration. Then, add the filter rule.

Translate
Kautuk Sahni
kautuk_sahni
Level 9
Sep 28, 2023 9:43 AM UTC
kautuk_sahni
Level 9
Oct 4, 2023 7:24 AM UTC

@rajesh_didshe Were you able to succeed? 

Translate
Kautuk Sahni
Oct 7, 2023 10:29 AM UTC

 @kautuk_sahni 

dispatcher.any file is immutable, So tried above step in filter.any file but getting build error for action.

 

Translate