How to cache pages with selector in URL | Community
Skip to main content
Level 5
December 13, 2021
Solved

How to cache pages with selector in URL

  • December 13, 2021
  • 1 reply
  • 3089 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SrikanthPo3

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-karuppsamy 

1 reply

Raja-Karuppsamy
Community Advisor
Community Advisor
December 13, 2021

@srikanthpo3 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.

 

Level 5
December 14, 2021

Hi @raja-karuppsamy, 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.

SrikanthPo3AuthorAccepted solution
Level 5
December 20, 2021

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-karuppsamy