Quais solicitações e respostas HTTP fazem AEM cache do Dispatcher? (AEM Dispatcher 4.3.3)
A documentação abrange os cenários mais importantes que afetam a capacidade de cache de solicitações e respostas que passam pelo módulo Dispatcher AEM. Todas as regras de cache não são abordadas.
Solicitação HTTP e regras de cache:
Para que uma solicitação HTTP possa ser armazenada em cache pelo Dispatcher, deve seguir as seguintes regras.
1. O URL É ABSOLUTO (NÃO COMEÇA COM . OU …), TEM UMA EXTENSÃO DE ARQUIVO E O NOME DO ARQUIVO NO URL FUNCIONA COMO UM ARQUIVO NO SISTEMA DE ARQUIVOS.
Mensagens de log relacionadas:
URI not canonical: %s. Unable to map URI to file : %s. cache file path too long temporary file path too long request URL has no extension |
---|
Exemplos:
/content/test |
não armazenado em cache |
---|---|
/content/test.html |
em cache |
2. NÃO TEM ESCRAVOS APÓS A PRIMEIRA EXTENSÃO DE ARQUIVO.
Mensagens de log relacionadas:
request URL has trailing slash |
---|
Exemplos:
/content/test.html/ |
não armazenado em cache |
---|---|
/content/test.html/foo.jpg |
não armazenado em cache |
/content/test.html |
em cache |
3. ELE USA O MÉTODO HTTP GET OU HEAD.
Mensagens de log relacionadas:
request method is neither GET nor HEAD |
---|
Exemplos:
HEAD /content/test.html HTTP/1.1 |
em cache |
---|---|
GET /content/dam/test.jpg HTTP/1.1 |
não armazenado em cache |
POST /content/test.html HTTP/1.1 |
não armazenado em cache |
4. A SOLICITAÇÃO É NEGADA POR /CACHE = /REGRAS DEFINIDAS NA CONFIGURAÇÃO DO DISPATCHER .ANY FARM.
Mensagens de log relacionadas:
URI not in cache rules: %s request URL not in cache rules |
---|
Exemplos:
O farm tem /cache = /rules e uma solicitação é recebida para /content/test.html /cache &chave; … /rules &chave; /0001 &chave; tipo "negar" glob "*" &raste; &raste; |
não armazenado em cache |
---|---|
O farm tem /cache = /rules e uma solicitação é recebida para /content/test.html /cache &chave; … /rules &chave; /0001 &chave; tipo "allow" glob "*" &raste; &raste; |
em cache |
5. A SOLICITAÇÃO HTTP NÃO CONTÉM UM CABEÇALHO DE AUTORIZAÇÃO OU CONTÉM O CABEÇALHO, MAS /ALLOWAUTHORIZED É DEFINIDO COMO 1 NA CONFIGURAÇÃO DO FARM.
Mensagens de log relacionadas:
request contains authorization |
---|
Exemplos:
Solicitação HTTP: GET /content/test.html HTTP/1.1 Autorização: YWxhZGRpbjpvcGVuc2VzYW1l básico dispatcher.any farm /cache = /allowAuthorized configuration: /cache { /allowAuthorized "0" &raste; |
não armazenado em cache |
---|---|
Solicitação HTTP: GET /content/test.html HTTP/1.1 Autorização: YWxhZGRpbjpvcGVuc2VzYW1l básico dispatcher.any farm /cache = /allowAuthorized configuration: /cache { /allowAuthorized "1" &raste; |
em cache |
6. A SOLICITAÇÃO HTTP CONTÉM TOKEN DE LOGON OU COOKIE DE AUTORIZAÇÃO NO CABEÇALHO DO COOKIE OU CONTÉM (OU AMBOS) DESSES COOKIES E /ALLOWAUTHORIZED ESTÁ DEFINIDO COMO 1 NA CONFIGURAÇÃO DO FARM.
Mensagens de log relacionadas:
request contains authorization |
---|
Exemplos:
Mensagem de log relacionada:
Exemplos:
Solicitação HTTP: GET /content/test.html HTTP/1.1 Cookie: login-token=… dispatcher.any farm /cache = /allowAuthorized configuration: /cache { /allowAuthorized "0" &raste; |
não armazenado em cache |
---|---|
Solicitação HTTP: GET /content/test.html HTTP/1.1 Cookie: authorization=YWxhZGRpbjpvcGVuc2VzYW1l dispatcher.any farm /cache = /allowAuthorized configuration: /cache { /allowAuthorized "0" &raste; |
não armazenado em cache |
Solicitação HTTP: GET /content/test.html HTTP/1.1 Cookie: login-token=… dispatcher.any farm /cache = /allowAuthorized configuration: /cache { /allowAuthorized "1" &raste; |
em cache |
7. HÁ UM PARÂMETRO DE SEQUÊNCIA DE CONSULTA NO URL E O PARÂMETRO PODE SER IGNORADO POR MEIO DA CONFIGURAÇÃO /IGNOREURLPARAMS DO FARM.
Mensagens de log relacionadas:
request contains a query string |
---|
Exemplos:
Solicitação HTTP: GET /content/test.html?test=1 HTTP/1.1 Configuração de farm/cache: /ignoreUrlParams { /0001 &chave; /type "allow" /glob "*" } &raste; |
em cache |
---|---|
Solicitação HTTP: GET /content/test.html?test=1 HTTP/1.1 Configuração de farm/cache: /ignoreUrlParams { /0001 &chave; /type "deny" /glob "*" } /0001 &chave; /type "allow" /glob "test" } &raste; |
em cache |
Solicitação HTTP: GET /content/test.html?test=1 HTTP/1.1 dispatcher.any farm /cache = /allowAuthorized configuration: /ignoreUrlParams { /0001 &chave; /type "deny" /glob "*" } /0001 &chave; /type "allow" /glob "q" } &raste; |
não armazenado em cache |
Resposta HTTP e regras de cache:
A resposta HTTP retornada do AEM pode ser armazenada em cache se os seguintes critérios forem atendidos.
1. O DISPATCHER PODE ENVIAR E RECEBER UMA RESPOSTA 200 OK A PARTIR DE UMA DAS "RENDERIZAÇÕES" DEFINIDAS.
Observação:
Se não /timeout está definida no /renders
ou está definido como 0 então, ela esperaria para sempre por uma conexão com a instância de AEM mesmo se a instância estivesse inativa.
Mensagens de log relacionadas:
Unable to send request to remote server. Unable to receive response from remote server. Remote server returned: %s No backend available. |
---|
Exemplos:
Solicitação HTTP: 200 OK |
em cache |
---|---|
Solicitação HTTP: 404 Página não encontrada |
não armazenado em cache |
2. NENHUM DESSES CABEÇALHOS DE RESPOSTA ESTÁ PRESENTE NA RESPOSTA:
Dispatcher: no-cache
Cache-control: no-cache
Pragma: no-cache
Mensagem de log relacionada:
Backend forbids caching: %s, sent: %s" response contains no_cache |
---|
Exemplos:
Resposta HTTP: 200 OK Dispatcher: no-cache |
não armazenado em cache |
---|---|
Resposta HTTP: 200 OK Controle de cache: no-cache |
não armazenado em cache |
Resposta HTTP: 200 OK Pragma: no-cache |
não armazenado em cache |
Resposta HTTP: 200 OK |
em cache |
3. O VALOR DE COMPRIMENTO DE CONTEÚDO É MAIOR QUE ZERO BYTES.
Mensagem de log relacionada:
response content length is zero |
---|
Exemplos:
Resposta HTTP: 200 OK Duração do conteúdo: 0 |
não armazenado em cache |
---|---|
Resposta HTTP: 200 OK Duração do conteúdo: 3120 |
em cache |