How to access cached content from dispatcher? | Community
Skip to main content
GK-007
Level 9
August 26, 2016
Solved

How to access cached content from dispatcher?

  • August 26, 2016
  • 3 replies
  • 1955 views

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

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 kautuk_sahni

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

3 replies

Jitendra_S_Toma
Level 10
August 27, 2016

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

 

antoniom5495929
Level 7
August 27, 2016

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.

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
August 29, 2016

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