Is it possible to recursively hide directories in apache CQ5 / AEM manager?

I have a dispatcher configured with a rather deep level of statistics file due to a specific project in a situation with multiple tenants.

What I hope is a way to clean directories recursively to simulate a lower level of statistics files for other tenants.

Is there a dispatcher reset command that allows me to explicitly delete the content directory?

+6
source share
2 answers

You can achieve this yourself by sending a simple GET request to your dispatcher. The path on the Manager you need is /dispatcher/invalidate.cache .

The following headers guarantee proper processing:

  • CQ-Action: To delete content, it can be set to "DELETE". I think that "EXPIRE" also works to mark content as outdated, but not physically remove it from the cache.
  • CQ-Handle: Indicates what needs to be deleted, starting from the root folder of your cache. For instance. "/ content / geometrixx" will remove geometrixx and everything below it. "/" will delete everything in the cache.
  • Content-Length and Content-Type: Verify that the request is processed correctly. Since we are not sending the body, the length can be set to 0. Content-Type can be "application / octet-stream" (did not try other values).

The last curl command you built will look something like this:

 curl -v \ -H "CQ-Action: DELETE" \ -H "CQ-Handle:/" \ -H "Content-Length: 0" \ -H "Content-Type: application/octet-stream" \ http://localhost:80/dispatcher/invalidate.cache; 

(where this removes everything from the cache on the Dispatcher running under the local host on port 80. These traces are optional here, they just make reading easier)


You can send this GET request from any field (subject to the limitations of your firewall, etc.), for example, it can be obtained from:

  • your CI build agent
  • scheduled task in publication instance
  • An administrative component in an Author instance that accepts a given path for cleaning.
+4
source

I don’t understand the big picture, but the IIRC manager is flash if you clear the entire directory and all its subdirectories. The file types to be reset depend on the configuration of your dispatcher.

So, if you clean / content / geometrixx, the whole site will be cleaned. (Please someone correct me if I make a mistake).

The easiest way to do this is IMHO to re-activate a page that works as the root of the area you want to reset. Otherwise, you could even develop your own servlet servlet that sends the appropriate headers to the dispatcher

http://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/replication.html#Extended

Other parameters that always work are the same as the HTTP headers, but are sent using curl commands or OS processes that remove a directory from the file system.

I am not saying that the last two are the best, as there may be side consequences; but they also have to do this work.

0
source

Source: https://habr.com/ru/post/972804/


All Articles