Do not cache few pages and sub pages in Dispatcher | Community
Skip to main content
Level 7
March 15, 2024
Solved

Do not cache few pages and sub pages in Dispatcher

  • March 15, 2024
  • 1 reply
  • 720 views

Hello Team,

 

I dont want to cache few pages (e.g : Login, registration pages). Then, I need to mention below snippet under /cache section. Am I right?

 

 /0xxx
{
/foo/login/* -> all pages below /foo/login
/foo/login[./]* -> all pages below and /foo/login itself

/glob "*"
/type "deny"
}

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 Madhur-Madan

Hi @mahesh_gunaje ,

 

Your proposed configuration appears to be aimed at denying caching for pages under the /foo/login path in AEM Dispatcher. However, it seems there's a slight misunderstanding in the syntax. The configuration should look more like this:

/cache { /0xxx { /glob "*" { /foo/login* # Deny caching for all pages under /foo/login /foo/login[./] # Deny caching for /foo/login itself and all pages below it } /type "deny" } }

 

This configuration instructs the Dispatcher to deny caching for all pages under the /foo/login path, including the login page itself, as well as any pages below it. Make sure to adjust the path (/foo/login) according to your specific URL structure.

Thanks,
Madhur

1 reply

Madhur-Madan
Community Advisor
Madhur-MadanCommunity AdvisorAccepted solution
Community Advisor
March 15, 2024

Hi @mahesh_gunaje ,

 

Your proposed configuration appears to be aimed at denying caching for pages under the /foo/login path in AEM Dispatcher. However, it seems there's a slight misunderstanding in the syntax. The configuration should look more like this:

/cache { /0xxx { /glob "*" { /foo/login* # Deny caching for all pages under /foo/login /foo/login[./] # Deny caching for /foo/login itself and all pages below it } /type "deny" } }

 

This configuration instructs the Dispatcher to deny caching for all pages under the /foo/login path, including the login page itself, as well as any pages below it. Make sure to adjust the path (/foo/login) according to your specific URL structure.

Thanks,
Madhur

Madhur-Madan
Community Advisor
Community Advisor
March 15, 2024

@mahesh_gunaje ,

There is an alternate syntax to it as well just in case you need it

/cache { /rules { /0000 { /glob "*" /type "allow" } /0001 { /glob "/foo/login/*" /type "deny" } /0002 { /glob "/foo/login[./]" /type "deny" } } }

You can refer the following document if you need more clarity on dispatcher rules
https://experienceleague.adobe.com/en/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration#configuring-the-dispatcher-cache-cache

Level 7
March 15, 2024

Hi @madhur-madan 

 

Thanks for the snippet. 1 more query:  is use of /glob is right compare to /url ?

Since, I heard about use of /glob is deprecated in dispatcher file.