AEM Dispatcher 缓存规则

AEM Dispatcher Cache Rule s

我想添加一个缓存规则来缓存具有给定 url/path 的多个扩展。

样本:

/rules

  /0100
  {
   /url "/urlpath/*"
   /type "allow"
   /extension '(json|xml|html|clientlibs|css|gif|ico|js|png|swf|jpe?g|woff2?)'
  }

这有效吗?

您必须遵循 specifying documents to cache 的要求:

Each item in the /rules property includes a glob pattern and a type:

The glob pattern is used to match the path of the document.
The type indicates whether to cache the documents that match the glob pattern. 
The value can be either allow (to cache the document) or
deny (to always render the document).

您似乎正试图在缓存部分使用 filter rules 的语法。我认为您需要使用匹配 URL 的 glob 模式和使用通配符的扩展名,因此您可能需要使用多个规则。