Expand my Community achievements bar.

SOLVED

How does AMS cache optimize AEM site performance?

Avatar

Level 2

Hello, I manage an AEM site on Adobe Cloud, tailoring it to a specific organization. We maintain three environments: Dev, Stage, and Production.

VuongNguyen_0-1706112443709.png

As you can see, we want to improve Cache-Control: Private (Images Only) to Cache-Control: Public (Images Only). When we follow up document in https://experienceleague.adobe.com/docs/experience-manager-learn/ams/dispatcher/explanation-config-f... and based on diagram as below:

As you can see here, I will notice that available_vhosts/*.vhost and in AEM project, we will have dispatcher module to configure. For example: flagtick.vhosts based on absolute path: src/conf.d/available_vhosts/flagtick.vhost. Upon, we define logics for file as below:

<VirtualHost *:80>
   ... 
   <LocationMatch "^/content/${CONTENT_FOLDER_NAME}/us/en/(.*).html$">
         Header set Cache-Control "max-age=1800,public"
    </LocationMatch>
    <LocationMatch "^/etc\.clientlibs/.*\.(?i:js|css|ttf|svg)$">
        Header set Cache-Control "max-age=31536000,stale-while-revalidate=43200,stale-if-error=43200,public,immutable"
    </LocationMatch>
    <LocationMatch "^/content/.*\.(?i:jpe?g|gif|js|mov|png|svg|txt|zip|pdf|ico)$">
        Header set Cache-Control "max-age=1800,public,s-maxage=86400,stale-while-revalidate=43200,stale-if-error=43200"
    </LocationMatch>
</VirtualHost>

In the vhost file, images are set to be cached for a year and shared among requests. This means images are stored in the dispatcher layer, and the status code can change from 200 to 304 (unmodified).
In reality, after deploy to Adobe Cloud and open publish server for checking? It's not working and keep this configuration for all images requested.

Capture.PNG

It still keep private, max-age=600. I suspect that configuration not apply for port 443 in Adobe Cloud because Port 80 is configure for HTTP not HTTPS. So, any one can help me light up here and give me suggestion to follow up and fix it?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

HI @VuongNguyen 
Did you try ?

 

Change the older default behavior to be consistent with the new behavior (program ids that are higher than 65000) by setting the Cloud Manager environment variable AEM_BLOB_ENABLE_CACHING_HEADERS to true. If the program is already live, make sure you verify that after the changes, content behaves as you expect.



Arun Patidar

View solution in original post

3 Replies

Avatar

Level 2

Hi, Thank you for your response. But, follow up the second link, I have completely configurated cache those things like HTML/Page, Images (from private to public). But, it not affects on Adobe Cloud. If you mention that is default, how we can override it?

The report on BPO shows Cache-Control: Private (image only) still there.

Avatar

Correct answer by
Community Advisor

HI @VuongNguyen 
Did you try ?

 

Change the older default behavior to be consistent with the new behavior (program ids that are higher than 65000) by setting the Cloud Manager environment variable AEM_BLOB_ENABLE_CACHING_HEADERS to true. If the program is already live, make sure you verify that after the changes, content behaves as you expect.



Arun Patidar