Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to access cached content from dispatcher?

Avatar

Level 9

Hi All,

I want to access cached content resided at dispatcher.Let's say  i have image and it has four renditions.

I want to validate them whether they are cached or not without logging into dispatcher host.

Please help!!!

Thanks,

Kishore

1 Accepted Solution

Avatar

Correct answer by
Administrator

Jitendra S.Tomar wrote...

Hi KIshore,

To  validate whether a particular asset is cached or not. Check the following things:

  • Is asset return 404? if not then dispatcher is allowing this asset to be served.
  • Check the response headers of particular asset request in the browser console.
  • Check Cache-Control & X-Cache response headers. it provides more information about caching.

Kishore@CQ wrote...

Hi All,

I want to access cached content resided at dispatcher.Let's say  i have image and it has four renditions.

I want to validate them whether they are cached or not without logging into dispatcher host.

Please help!!!

Thanks,

Kishore

 

 

 

Adding to Jitendra's comment

"To  validate whether a particular asset is cached or not. Check the following things:

  • Is asset return 404? if not then dispatcher is allowing this asset to be served.
  • Check the response headers of particular asset request in the browser console.
  • Check Cache-Control & X-Cache response headers. it provides more information about caching.

"

The Adobe AEM dispatcher simply takes the response body from requests made into the AEM instances and saves them as files that then the httpd can deliver. The dispatcher can be configured to allow requests to be either cached or sent directly to the AEM instance. This configuration is done in a file dispatcher.any. Check the documentation, it is good enough.

In general you decide what is cached and what not by defining a set of rules. "allow" means to cache and "deny" not to cache. For example:

        /rules
        {
          /0000  { /glob "*" /type "allow" }
          /0001  { /glob "/en/news/*" /type "deny" }
          /0002  { /glob "*/private/*" /type "deny"  }   
         }

Will:

  • by default cache every request (rule 0000)
  • send to the instance requests to that contain "/en/news/" and "/private/*" (rules 0001 and 0002).

 

Reference article :- http://stackoverflow.com/questions/27248505/how-to-find-out-what-does-dispatcher-cache

Community Article :- http://www.wemblog.com/2012/05/how-to-use-dispatcher-to-serve-cache.html

//How to use dispatcher to serve cache content if render is unavailable in AEM

 

~kautuk



Kautuk Sahni

View solution in original post

3 Replies

Avatar

Level 9

Hi KIshore,

To  validate whether a particular asset is cached or not. Check the following things:

  • Is asset return 404? if not then dispatcher is allowing this asset to be served.
  • Check the response headers of particular asset request in the browser console.
  • Check Cache-Control & X-Cache response headers. it provides more information about caching.

Kishore@CQ wrote...

Hi All,

I want to access cached content resided at dispatcher.Let's say  i have image and it has four renditions.

I want to validate them whether they are cached or not without logging into dispatcher host.

Please help!!!

Thanks,

Kishore

 

Avatar

Level 7

If you have dispatcher module configured to cache images, each image request is served by dispatcher if the request comes without a query string.

Even if, if you have your dispatcher configured with 'allow authorized / false' your loggedin request doesn't take values from the cache.

I hope this can help you.

Avatar

Correct answer by
Administrator

Jitendra S.Tomar wrote...

Hi KIshore,

To  validate whether a particular asset is cached or not. Check the following things:

  • Is asset return 404? if not then dispatcher is allowing this asset to be served.
  • Check the response headers of particular asset request in the browser console.
  • Check Cache-Control & X-Cache response headers. it provides more information about caching.

Kishore@CQ wrote...

Hi All,

I want to access cached content resided at dispatcher.Let's say  i have image and it has four renditions.

I want to validate them whether they are cached or not without logging into dispatcher host.

Please help!!!

Thanks,

Kishore

 

 

 

Adding to Jitendra's comment

"To  validate whether a particular asset is cached or not. Check the following things:

  • Is asset return 404? if not then dispatcher is allowing this asset to be served.
  • Check the response headers of particular asset request in the browser console.
  • Check Cache-Control & X-Cache response headers. it provides more information about caching.

"

The Adobe AEM dispatcher simply takes the response body from requests made into the AEM instances and saves them as files that then the httpd can deliver. The dispatcher can be configured to allow requests to be either cached or sent directly to the AEM instance. This configuration is done in a file dispatcher.any. Check the documentation, it is good enough.

In general you decide what is cached and what not by defining a set of rules. "allow" means to cache and "deny" not to cache. For example:

        /rules
        {
          /0000  { /glob "*" /type "allow" }
          /0001  { /glob "/en/news/*" /type "deny" }
          /0002  { /glob "*/private/*" /type "deny"  }   
         }

Will:

  • by default cache every request (rule 0000)
  • send to the instance requests to that contain "/en/news/" and "/private/*" (rules 0001 and 0002).

 

Reference article :- http://stackoverflow.com/questions/27248505/how-to-find-out-what-does-dispatcher-cache

Community Article :- http://www.wemblog.com/2012/05/how-to-use-dispatcher-to-serve-cache.html

//How to use dispatcher to serve cache content if render is unavailable in AEM

 

~kautuk



Kautuk Sahni