Expand my Community achievements bar.

SOLVED

Do not cache few pages and sub pages in Dispatcher

Avatar

Level 8

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"
}

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Community Advisor

@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/dispatche...

Avatar

Level 8

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.