Expand my Community achievements bar.

Cache not getting created under /content/ {project}/ directory

Avatar

Level 4

Hi,

 

For my project which is on AEM 6.5 we discovered that the cache is not getting created under /content/{project}/ path.

If we hit page with .html extension the cache is getting created but under the /var/www/html directory, but pages without html extension the cache is not at all getting created.

 

I know that dispatcher doesn’t cache pages without html extension, but we want the pages cached.

 

In httpd.conf

 Document root = /var/www/html 


Thanks,

Sweta

 

 

@arunpatidar @Jörg_Hoh 

5 Replies

Avatar

Level 2

@SwetaB 

There are several articles out there in this topic. I found very useful this one: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/html-removal-for-live-url/...

I believe it explains your exact use case.

Avatar

Level 2

We tried "PT" in rewrite rule, but still it not serving the page from dispatcher when there is no html extension.

 

RewriteRule ^(/content/cms/pages/abc/[0-9]{4}/[0-9]{2}/[0-9]{1}/)(.*).html$ /$2 [R=301,PT,L]

Since we are shortening the URL, we are using R.

 example - <domain>/content/cms/pages/abc/bdu21121woq6611s.html to <domina>/bdu21121woq6611s 

In vhost, we are doing below config for setting pages to be cached

<LocationMatch "^/bdu.*">
Header unset Cache-Control
Header unset Expires
Header always set Cache-Control "max-age=60, s-maxage=14400"
Header set Age 0
</LocationMatch>

Avatar

Level 2

We tried "PT" in rewrite rule, but still it not serving the page from dispatcher when there is no html extension.

RewriteRule ^(/content/cms/pages/abc/[0-9]{4}/[0-9]{2}/[0-9]{1}/)(.*).html$ /$2 [R=301,PT,L]

Since we are shortening the URL, we are using R.

 example - <domain>/content/cms/pages/abc/bdu21121woq6611s.html to <domina>/bdu21121woq6611s 

In vhost, we are doing below config for setting pages to be cached

<LocationMatch "^/bdu.*">
Header unset Cache-Control
Header unset Expires
Header always set Cache-Control "max-age=60, s-maxage=14400"
Header set Age 0
</LocationMatch>

Avatar

Community Advisor

Hi @SwetaB 

Dispatcher will not cache any content without any extension. So if you want to cache any content and at the same time you do not want the extension to be shown to the end user, you can use the sling mapping feature. You can create mapping rules under /etc/maps which can be also used to shorten the URL (if needed) and the rewrite rule can be added in the dispatcher to request the full path to the publish instance from dispatcher.

So always the enduser will see the shortened/extensionless URL whereas the content will be served from cache as it has the extension.

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/deploying/conf...

Let me know if you need more help on this.

Thanks,

Asutosh