January 4, 2021
Estimated Post Reading Time ~

AEM — Versioned Clientlibs

SYNOPSIS:
Guide to configure versioned client libraries on AEM and IIS web server on Windows 10 Enterprise.

Tools Used:
  • AEM
  • IIS Webserver
  • ACS Commons Package Version 3.17.x
Prerequisites:
  • AEM Publish instance up and running
  • ACS commons package pre-installed
  • IIS Website for AEM Instance
Guide:
STEP-01: ACS Commons Verification

NOTE: It is presumed that ACS Commons is already installed on the AEM instance


ACS Commons Package — version Installed 3.17
  1. Go to CRX Package manager
  2. Search for ACS commons
  3. Verify that the package is installed [if not use this link to install and configure ACS Commons
STEP-02: Application Config Directory

Application Config Directory
  1. Go to CRXDE
  2. select the apps folder
  3. select your application [sdintranet] where you want to enable versioned clientlibs
  4. select config folder
STEP-03: Create a rewriter configuration folder

App config folder

Rewriter configuration folder
  1. Right-Click on the config folder
  2. select Create
  3. select create Node
  4. on the pop-up window
  5. name: rewriter
  6. Type: sling: Folder
  7. Click OK
  8. Press Save All
Step-04: Copy default rewriter configurations from Library (OOTB)

Copy OOTB rewriter config


Rewriter config on app config folder


Verify and Save
  1. Go to libs
  2. select cq
  3. select config
  4. select rewriter and right-click on the default
  5. copy the default config
  6. go to apps
  7. go to sdintranet application
  8. select config
  9. select rewriter and right-click on the rewriter folder
  10. paste, verify and press Save All
STEP-05: [Optional] Rename default config to an appropriate configuration

Rename the configuration

STEP-06: Add transformer Type – versioned-clientlibs

Edit the transformer types

Add the clientlibs transformer type
  1. Select the renamed rewriter [/apps/sdIntranet/config/rewriter/versioned-clientlibs]
  2. Edit the transformerTypes property
  3. click the + symbol
  4. Add the transformerType versioned-clientlibs
  5. Click OK
  6. Press Save All
STEP-07: Restart AEM instance for the changes to take effect
Make sure you restart the AEM instance, for the clientlibs to take effect, Restarting the remote server can be done in any way you are comfortable, one can directly log into the instance and restart the AEM service, or can remotely restart using Jenkins if configured or can restart using Remote Session.


Get the remote service information

Stop the service

Start the service

STEP-08: Verify the sling rewriter status


versioned clientlibs verification
STEP-09: Configure IIS to send the right header to set a long TTL

Add the following to the IIS webservers system/web.server sectionGroup

    <httpProtocol>
            <customHeaders>
                <remove name="X-Powered-By" />
                <add name="X-XSS-Protection" value="1; mode=block" />
                <add name="X-Content-Type-Options" value="nosniff" />
                <add name="Cache-Control" value="max-age=2592000" />
                <add name="Strict-Transport-Security" value="max-age=31536000" />
                <add name="Access-Control-Allow-Origin" value="*" />
                <add name="Access-Control-Allow-Methods" value="GET" />
                <add name="Access-Control-Allow-Headers" value="Content-Type" />
            </customHeaders>
        </httpProtocol>


IIS Configuration to send the right header to set a long TTL


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.