【问题标题】:Does file extension is same as url extension in Sling文件扩展名是否与 Sling 中的 url 扩展名相同
【发布时间】:2014-12-05 12:05:22
【问题描述】:

Sling 中的 URL 具有以下结构:

我还阅读了以下information aboutn dispatcher cache:

The Dispatcher always requests the document directly from the AEM instance in the following cases:

If the HTTP method is not GET. Other common methods are POST for form data and HEAD for the HTTP header.
If the request URI contains a question mark "?". This usually indicates a dynamic page, such as a search result, which does not need to be cached.
The file extension is missing. The web server needs the extension to determine the document type (the MIME-type).
The authentication header is set (this can be configured)

我有两个误解:

  1. myurl.com/foo.jsp/parameter/values 是否会遵守以下规则:

    缺少文件扩展名。 Web 服务器需要扩展来确定文档类型(MIME 类型)。

?

  1. 公式Dispatcher 始终直接从 AEM 实例请求文档 不能保证在其他情况下请求会被缓存,但我想确保我的请求会被缓存。

附言

请从一开始就提供具体步骤如何检查具体网址是否兑现。

【问题讨论】:

  • 您提供的备忘单不是 Sling 的结构。它只是解释了 Sling 如何决定使用哪个脚本来呈现特定请求。

标签: caching aem dispatcher sling


【解决方案1】:

该备忘单仅描述了如何选择脚本来呈现特定请求。它与 Apache Dispatcher 无关。

正如我回答 in your other question 时,调度程序缓存或不缓存的内容由您设置的规则定义(除了提到的例外情况)。

检查特定请求是否会被缓存的步骤是获取该请求并将其与每个调度程序规则进行比较。应用最后一个匹配规则。

resourceTypes 和其他 sling 概念在这里无关紧要。仅检查 url 字符串。您的示例网址没有扩展名,因此不会被缓存。

【讨论】:

    【解决方案2】:

    你不应该使用 foo.jsp,你应该使用 foo.html 或任何你想要的格式。

    吊索中的“后缀”是您在.html 之后的 /parameter/whatever 后面所说的部分

    根据我的理解和文档,如果没有查询字符串,这应该由调度程序缓存。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-19
      • 2012-05-12
      • 2015-04-02
      • 1970-01-01
      • 2016-04-06
      • 1970-01-01
      • 2012-12-24
      • 1970-01-01
      相关资源
      最近更新 更多