Instellen Sling Dynamic Include
Een videolooppas-door van het installeren van en het gebruiken van Apache Sling Dynamic Include met AEM Dispatcherlopend op Apache HTTP Web Server.
-
Download en installeer de Sling Dynamic Include bundel.
-
Vorm Sling Dynamic Include via OSGi Configuration Factory in http://<host>:<port>/system/console/configMgr/org.apache.sling.dynamicinclude.Configuration.
Of, om aan een AEM code-basis toe te voegen, creeer de aangewezen gooi:OsgiConfig knoop bij:
code language-xml <?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+) -->
-
(Facultatief) herhaal de laatste stap om voor componenten op gesloten (aanvankelijke) inhoud van editable malplaatjestoe te staan om via SDI eveneens te worden gediend. De reden voor de extra configuratie is dat vergrendelde inhoud van bewerkbare sjablonen wordt aangeboden vanuit
/conf
in plaats van/content
.code language-xml <?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+) -->
-
Werk het
httpd.conf
-bestand van Apache HTTPD Web server bij om de Include -module in te schakelen.code language-shell $ sudo vi .../httpd.conf
code language-shell LoadModule include_module libexec/apache2/mod_include.so
-
Werk het vhost -bestand bij om instructies te respecteren.
code language-shell $ sudo vi .../vhosts/aem-publish.local.conf
code language-shell <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>
-
Werk het dispatcher.any-configuratiebestand bij ter ondersteuning van (1)
nocache
kiezers en (2) schakel TTL-ondersteuning in.code language-shell $ sudo vi .../conf/dispatcher.any
code language-shell /rules { ... /0009 { /glob "*.nocache.html*" /type "deny" } }
note tip TIP Als u de *
volgende regel in de algemene regel*.nocache.html*
hierboven weglaat, kan dit resulteren in problemen in verzoeken om subresources.code language-shell /cache { ... /enableTTL "1" }
-
Start Apache HTTP Web Server altijd opnieuw nadat u wijzigingen hebt aangebracht in de configuratiebestanden of in
dispatcher.any
.code language-shell $ sudo apachectl restart
- "Cache-control"
- "Content-Disposition"
- "Content-Type"
- "Verloopt"
- "Laatst gewijzigd"
- "ETag"
- "X-Content-Type-Options"
- "Laatst gewijzigd"