Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to cache pages with selector in URL

Avatar

Level 5

Hi Team,

I am looking for a way to cache pages with selectors in their URLs in AEM disaptcher. For example https://www.mycompany.com/a/b.html/suffix is cached in AEM dispatcher but page with selector "print" https://www.mycompany.com/a/b.print.html/suffix is not cached currently.

Thanks in advance.

Srikanth Pogula

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi All, was able to get it to work by adding an extension after suffix in rewrite rule since dispatcher does not cache extension-less URLs.

Thanks for the help @Raja-kp 

View solution in original post

3 Replies

Avatar

Community Advisor

@srikanthpogula Please try the below:

  1. Keep the dispatcher.log level as TRACE.
  2. Access your page content - tail the dispatcher.log and check the page response, from where/how you are getting the page response.
  3. Try to update the rule in the /rules property of cache section to allow to cache the page path: "*.path.html".
  4. Open the httpd.conf file - for your cache directory and delete the MultiViews.

Options FollowSymLinks MultiViews
AllowOverride all

 

Please post response.

 

Avatar

Level 5

Hi @Raja-kp, can you please elaborate on #4, should I remove MultiViews? I tried but still cache is not created for page with selector in URL. From disaptcher log, can see that page is rendered from publish not from cache. It appears that no cache rule is found for this request and cache action is NONE

I have added below cache rule because page URL(https://www.mycompany.com/a/b.print.html/suffix) has suffix

/0405 { /glob "*.print.html/*" /type "allow" }.

Please let me know if this is incorrect.

 

Thanks

Srikanth Pogula.

Avatar

Correct answer by
Level 5

Hi All, was able to get it to work by adding an extension after suffix in rewrite rule since dispatcher does not cache extension-less URLs.

Thanks for the help @Raja-kp