Search code examples
cachingaemdispatchersling

Does file extension is same as url extension in Sling


Url in Sling has following structure:enter image description here

Also I have read following 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)

I have 2 misunderstandings:

  1. Will myurl.com/foo.jsp/parameter/values comply with following rules:

    The file extension is missing. The web server needs the extension to determine the document type (the MIME-type).

?

  1. formulation Dispatcher always requests the document directly from the AEM instance doesn't guarantee that in the rest situations request will be cached but I want to be sure that my request will be cached.

P.S

Please provide concrete steps from the begining how to check that concrete url cashes or not.


Solution

  • That Cheatsheet merely describes how a script is selected to render a specific request. It has no relation with the Apache Dispatcher.

    As I answered in your other question what the dispatcher caches or not caches is defined by the rules you set (except for the mentioned exceptions).

    The steps to check if a particularly request will be cached is take that request and compare it against each one of the dispatcher rules. The last matching rule is applied.

    resourceTypes and other sling concepts are irrelevant here. Only the url string is checked. Your example url has no extension so it wont be cached.