설명서AEMAEM 튜토리얼AEM Foundation 튜토리얼

Sling Dynamic Include 설정

마지막 업데이트: 2025년 5월 5일
  • 적용 대상:
  • Experience Manager 6.4
  • Experience Manager 6.5
  • 주제:
  • API

작성 대상:

  • 경험
  • 개발자

Apache HTTP Web Server에서 실행 중인 AEM Dispatcher와 함께 Apache Sling Dynamic Include을(를) 설치하고 사용하는 방법에 대한 비디오 연습입니다.

노트
최신 버전의 AEM Dispatcher이 로컬에 설치되어 있는지 확인합니다.
  1. Sling Dynamic Include 번들을(를) 다운로드하여 설치하십시오.

  2. http://<host>:<port>/system/console/configMgr/org.apache.sling.dynamicinclude.Configuration ​에서 OSGi Configuration Factory을(를) 통해 Sling Dynamic Include을(를) 구성합니다.

    또는 AEM 코드 기반에 추가하려면 다음 위치에 적절한 sling:OsgiConfig 노드를 만드십시오.

    <?xml version="1.0" encoding="UTF-8"?>
    <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"
        xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
        jcr:primaryType="sling:OsgiConfig"
        include-filter.config.enabled="{Boolean}true"
        include-filter.config.path="/content"
        include-filter.config.resource-types="[my-app/components/content/highly-dynamic]"
        include-filter.config.include-type="SSI"
        include-filter.config.add_comment="{Boolean}false"
        include-filter.config.selector="nocache"
        include-filter.config.ttl=""
        include-filter.config.required_header="Server-Agent=Communique-Dispatcher"
        include-filter.config.ignoreUrlParams="[]"
        include-filter.config.rewrite="{Boolean}true"
        />
    <!--
    * include-filter.config.include-type="SSI | ESI | JSI"
    * include-filter.config.ttl is # of seconds (requires AEM Dispatcher 4.1.11+)
    -->
    
  3. (선택 사항) 마지막 단계를 반복하여 편집 가능한 템플릿의 잠긴(초기) 콘텐츠에 있는 구성 요소를 SDI을(를) 통해서도 제공할 수 있습니다. 추가 구성의 이유는 편집 가능한 템플릿의 잠긴 콘텐츠가 /content 대신 /conf에서 제공되기 때문입니다.

    <?xml version="1.0" encoding="UTF-8"?>
    <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"
        xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
        jcr:primaryType="sling:OsgiConfig"
        include-filter.config.enabled="{Boolean}true"
        include-filter.config.path="/conf"
        include-filter.config.resource-types="[my-app/components/content/highly-dynamic]"
        include-filter.config.include-type="SSI"
        include-filter.config.add_comment="{Boolean}false"
        include-filter.config.selector="nocache"
        include-filter.config.ttl=""
        include-filter.config.required_header="Server-Agent=Communique-Dispatcher"
        include-filter.config.ignoreUrlParams="[]"
        include-filter.config.rewrite="{Boolean}true"
        />
    <!--
    * include-filter.config.include-type="SSI | ESI | JSI"
    * include-filter.config.ttl is # of seconds (requires AEM Dispatcher 4.1.11+)
    -->
    
  4. Apache HTTPD Web server의 httpd.conf 파일을 업데이트하여 Include 모듈을 사용하도록 설정합니다.

    $ sudo vi .../httpd.conf
    
    LoadModule include_module libexec/apache2/mod_include.so
    
  5. include 지시문을 준수하도록 vhost 파일을 업데이트하십시오.

    $ sudo vi .../vhosts/aem-publish.local.conf
    
    <VirtualHost *:80>
    ...
       <Directory /Library/WebServer/docroot/publish>
          ...
          # Add Includes to enable SSI Includes used by Sling Dynamic Include
          Options FollowSymLinks Includes
    
          # Required to have dispatcher-handler process includes
          ModMimeUsePathInfo On
    
          # Set includes to process .html files
          AddOutputFilter INCLUDES .html
          ...
       </Directory>
    ...
    </VirtualHost>
    
  6. (1) nocache 선택기를 지원하고 (2) TTL 지원을 사용하도록 Dispatcher.any 구성 파일을 업데이트합니다.

    $ sudo vi .../conf/dispatcher.any
    
    /rules {
      ...
      /0009 {
        /glob "*.nocache.html*"
        /type "deny"
      }
    }
    
    TIP
    위의 glob *.nocache.html* 규칙에서 후행 *을(를) 해제하면 하위 리소스에 대한 요청에 문제가 발생할 수 있습니다.
    /cache {
        ...
        /enableTTL "1"
    }
    
  7. 구성 파일 또는 dispatcher.any을(를) 변경한 후 항상 Apache HTTP Web Server을(를) 다시 시작하십시오.

    $ sudo apachectl restart
    
NOTE
ESI(Edge-side includes) 제공에 Sling Dynamic Includes을(를) 사용하는 경우 Dispatcher 캐시에 관련 응답 헤더를 캐시해야 합니다. 가능한 헤더에는 다음이 포함됩니다.
  • "Cache-Control"
  • "Content-Disposition"
  • "Content-Type"
  • "만료"
  • "Last-Modified"
  • "ETag"
  • "X-Content-Type-Options"
  • "Last-Modified"

지원 자료

  • Sling Dynamic Include 번들 다운로드
  • Apache Sling Dynamic Include 설명서
recommendation-more-help
c92bdb17-1e49-4e76-bcdd-89e4f85f45e6