是否可以递归刷新CQ5 / AEM Apache调度程序中的目录? [英] Is it possible to recursively flush directories in the CQ5/AEM apache dispatcher?

查看:53
本文介绍了是否可以递归刷新CQ5 / AEM Apache调度程序中的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于有一个多租户情况下的特定项目,我为调度员设置了相当深的统计文件级别。

I have a dispatcher set up with a fairly deep stats file level due to a particular project in a multi tenancy situation.

我希望的是能够递归刷新目录以模仿其他租户的更浅层的stats文件级别的方法。

What I'm hoping is for a way to be able to recursively flush directories to mimic a more shallow stats file level for the other tenants.

是否存在调度程序flush命令,该命令使我可以显式删除目录

Is there a dispatcher flush command that allows me to explicitly delete a directory of content?

推荐答案

您可以通过向调度员发送一个简单的GET请求来实现此目的。您需要命中的Dispatcher上的路径是 /dispatcher/invalidate.cache

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

以下标头可确保


  • CQ-Action :可以将其设置为 DELETE以删除内容。我认为 EXPIRE还可以将内容标记为过期,但不能将其从缓存中物理删除。

  • CQ-Handle:从缓存文件夹的根开始指定要删除的内容。例如。 / content / geometrixx,将删除geometrixx及其下的所有内容。 /将删除缓存中的所有内容。

  • Content-Length&内容类型:确保请求已正确处理。由于我们不发送正文,因此长度可以设置为0。Content-Type可以是 application / octet-stream(尚未尝试其他值)。

  • CQ-Action: This can be set to "DELETE" to remove the content. I think "EXPIRE" also works to flag the content as out-of-date, but not remove it physically from the cache.
  • CQ-Handle: This specifies what should be deleted, starting from the root of your cache folder. E.g. "/content/geometrixx", would remove geometrixx and everything under it. "/" would remove everything in the cache.
  • Content-Length & Content-Type: Ensure that the request is handled correctly. As we're not sending a body, the length can be set to 0. Content-Type can be "application/octet-stream" (haven't tried other values).

您将构建的最终curl命令如下所示:

The final curl command that you would build would then look something like:

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;

(其中这是从在端口80上的localhost下运行的Dispatcher上的高速缓存中删除所有内容的方式。

(Where this is removing everything from the cache on a Dispatcher running under localhost on port 80. This backslashes here are optional, just making it easier to read)

您可以从任何框中发出此GET请求(视您的情况而定)防火墙限制等),例如,它可能来自:

You could issue this GET request from any box (subject to your firewall restrictions, etc.), for example, it could come from:


  • 您的CI构建代理

  • 发布实例中的预定作业

  • 作者实例中的管理组件,该管理组件采用给定的刷新路径。

这篇关于是否可以递归刷新CQ5 / AEM Apache调度程序中的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆