gpt4 book ai didi

aem - CQ/AEM Dispatcher 不刷新二进制文件

转载 作者:行者123 更新时间:2023-12-04 16:46:50 26 4
gpt4 key购买 nike

我们的应用程序从遗留系统导入二进制文件(主要是 PDF),并将它们与一些元数据一起存储在页面上。

如果有更改,页面会自动激活。我们在复制日志中看到复制事件,并且在调度程序上也记录了一个无效事件。但是没有驱逐条目,旧的二进制文件仍然被缓存。

我们在二进制文件的这些容器页面旁边还有 HTML 页面,它们按预期工作。这是成功的 html 和不成功的 PDF 的两个日志条目:

确定:

[Thu Jul 03 09:26:33 2014] [D] [27635(24)] Found farm website for localhost:81 
[Thu Jul 03 09:26:33 2014] [D] [27635(24)] checking [/dispatcher/invalidate.cache]
[Thu Jul 03 09:26:33 2014] [I] [27635(24)] Activation detected: action=Activate [/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/test]
[Thu Jul 03 09:26:33 2014] [I] [27635(24)] Touched /app/C2Z/dyn/c2zcqdis/docroot/.stat
[Thu Jul 03 09:26:33 2014] [I] [27635(24)] Evicted /app/C2Z/dyn/c2zcqdis/docroot/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/test.html
[Thu Jul 03 09:26:33 2014] [D] [27635(24)] response.status = 200
[Thu Jul 03 09:26:33 2014] [D] [27635(24)] response.headers[Server] = "Communique/2.6.3 (build 5221)"
[Thu Jul 03 09:26:33 2014] [D] [27635(24)] response.headers[Content-Type] = "text/html"
[Thu Jul 03 09:26:33 2014] [D] [27635(24)] cache flushed
[Thu Jul 03 09:26:33 2014] [I] [27635(24)] "GET /dispatcher/invalidate.cache" 200 13 2ms

不行

[Thu Jul 03 09:30:45 2014] [D] [27635(24)] Found farm website for localhost:81 
[Thu Jul 03 09:30:45 2014] [D] [27635(24)] checking [/dispatcher/invalidate.cache]
[Thu Jul 03 09:30:45 2014] [I] [27635(24)] Activation detected: action=Activate [/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf]
[Thu Jul 03 09:30:45 2014] [I] [27635(24)] Touched /app/C2Z/dyn/c2zcqdis/docroot/.stat
[Thu Jul 03 09:30:45 2014] [D] [27635(24)] response.status = 200
[Thu Jul 03 09:30:45 2014] [D] [27635(24)] response.headers[Server] = "Communique/2.6.3 (build 5221)"
[Thu Jul 03 09:30:45 2014] [D] [27635(24)] response.headers[Content-Type] = "text/html"
[Thu Jul 03 09:30:45 2014] [D] [27635(24)] cache flushed
[Thu Jul 03 09:30:45 2014] [I] [27635(24)] "GET /dispatcher/invalidate.cache" 200 13 1ms

本例中的 PDF 存储在 jcr:content 节点正下方的名为“下载”的节点中。它的 html 容器从不直接调用,这在调度程序上不可用。所以用户直接请求文件:/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf/jcr%3acontent/download/file.res/as2p_vvm_ch_gl_fix_chf_.pdf

在 dispatcher.any 中,我们在激活时刷新所有 html 页面,但不刷新二进制文件。为了测试,我们添加了一个 allow *.pdf 但这无论如何都没有帮助。

/invalidate
{
/0000
{
/glob "*"
/type "deny"
}
/0001
{
/glob "*.html"
/type "allow"
}
}

在我看来,invalidate 调用应该只删除整个文件夹:/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf

知道为什么我们的二进制文件没有被刷新吗?

更新:在另一篇文章中提到了 dispatcher.any 中的 statfileslevel 属性。在我们的环境中,这被注释掉了。难道这可能是问题所在。可悲的是,我不完全理解这应该如何工作。级别是指从wwwroot还是从激活的页面?

最佳答案

看起来你的调度程序刷新问题是文件提供的路径使用 jcr%3acontent 而它应该使用 _jcr_content

Dispatcher flushing 删除正在刷新的路径下的文件夹_jcr_content。它不会删除 jcr%3acontent(url 解码为 jcr:content)。因此,您应该改为使用此 URL 提供 pdf:/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf/_jcr_content/download/file.res/as2p_vvm_ch_gl_fix_chf_.pdf

这会将 pdf 文件缓存在:{CACHEROOT}/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf/_jcr_content/download/file.res/as2p_vvm_ch_gl_fix_chf_.pdf

然后当这个路径被刷新时它会删除刷新路径下的子目录_jcr_content/content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf

更详细地说,当您对上述路径发出刷新请求时,将删除以下文件和目录:

  • /content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf.* 其中 * 是通配符
  • /content/offering/s2p/en/offerings/documents/Swiss_Mandate_Line/Review/as2p_vvm_ch_gl_fix_chf__pdf/_jcr_content

有关冲洗工作原理的详细信息,请参阅本演示文稿中的幻灯片 23: http://www.slideshare.net/andrewmkhoury/aem-cq-dispatcher-caching-webinar-2013

关于aem - CQ/AEM Dispatcher 不刷新二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24696342/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com