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

Invalidating cache on a specific folder

Avatar

Level 2

Hi everyone,

I would like to ask if it's possible to invalidate a cache on a specific folder?

(Ex: /etc/designs/my-app/headlibs/images/)

I've already checked the help files but only found at a folder level [0]

[0] - https://docs.adobe.com/docs/en/dispatcher/disp-config.html#Invalidating Files by Folder Level

Here's the example i've done on my publish-farm.any configuration

/invalidate

  {

  /0000

   {

   /glob "*"

   /type "deny"

   }

  /0001

   {

   /glob "*.html"

   /type "allow"

   }

  /0002 {

   /glob "*/etc/designs/my-app/headlibs/images/*"  

   /type "deny"

   } 

  }

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

When this is in the "invalidate" section of your dispatcher.any, you should set it to "allow". Then it will get invalidated (otherwise a version cached once is never going to be invalidated and replaced by newer versions).

Btw: You should use versioned clientlibs of ACS AEM Commons, which solves the problem of mutable CSS/JS Files elegantly :-) Then you don't need to invalidate them on the dispatcher cache any more.

Jörg

View solution in original post

5 Replies

Avatar

Administrator

Jörg Hoh​ Need your help here!!

~kautuk



Kautuk Sahni

Avatar

Employee Advisor

Why do you deny the invalidation of /etc/designs//my-apps/headlibs/images/? Assuming that there are no .html files you want to invalidate.

Jörg

Avatar

Level 2

Hi Jörg,

Oh sorry so it should be "allow" not deny am i correct? But is the implementation correct?

0002 {

   /glob "*/etc/designs/my-app/headlibs/images/*" 

   /type "allow"

   }

Avatar

Correct answer by
Employee Advisor

When this is in the "invalidate" section of your dispatcher.any, you should set it to "allow". Then it will get invalidated (otherwise a version cached once is never going to be invalidated and replaced by newer versions).

Btw: You should use versioned clientlibs of ACS AEM Commons, which solves the problem of mutable CSS/JS Files elegantly :-) Then you don't need to invalidate them on the dispatcher cache any more.

Jörg

Avatar

Level 2

Thanks that was really helpful. Will try to implement it and see the results