Skip to content

Commit

Permalink
Replace checkNotModified with isNotModified (#7914)
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 5, 2024
1 parent d97413f commit 97d83e1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions en/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ that uniquely identifies the requested resource, as a checksum does for a file,
in order to determine whether it matches a cached resource.

To take advantage of this header, you must either call the
``checkNotModified()`` method manually or include the
``isNotModified()`` method manually or include the
:doc:`/controllers/components/check-http-cache` in your controller::

public function index()
Expand All @@ -943,7 +943,7 @@ To take advantage of this header, you must either call the
$checksum = md5(json_encode($articles));

$response = $this->response->withEtag($checksum);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}

Expand All @@ -967,14 +967,14 @@ last time. Setting this header helps CakePHP tell caching clients whether the
response was modified or not based on their cache.

To take advantage of this header, you must either call the
``checkNotModified()`` method manually or include the
``isNotModified()`` method manually or include the
:doc:`/controllers/components/check-http-cache` in your controller::

public function view()
{
$article = $this->Articles->find()->first();
$response = $this->response->withModified($article->modified);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}
$this->response;
Expand All @@ -998,14 +998,14 @@ header::
Sending Not-Modified Responses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. php:method:: checkNotModified(Request $request)
.. php:method:: isNotModified(Request $request)
Compares the cache headers for the request object with the cache header from the
response and determines whether it can still be considered fresh. If so, deletes
the response content, and sends the `304 Not Modified` header::

// In a controller action.
if ($this->response->checkNotModified($this->request)) {
if ($this->response->isNotModified($this->request)) {
return $this->response;
}

Expand Down
12 changes: 6 additions & 6 deletions es/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ directamente. Esto se usa comúnmente con recursos estáticos como imágenes y o
El método ``withEtag()`` (llamado etiqueta de entidad) es una cadena que identifica de forma única el recurso solicitado,
como lo hace una suma de comprobación para un archivo, para determinar si coincide con un recurso almacenado en caché.

Para aprovechar este encabezado, debe llamar al método ``checkNotModified()`` manualmente o incluir
Para aprovechar este encabezado, debe llamar al método ``isNotModified()`` manualmente o incluir
:doc:`/controllers/components/check-http-cache` en su controlador::

public function index()
Expand All @@ -872,7 +872,7 @@ Para aprovechar este encabezado, debe llamar al método ``checkNotModified()`` m
$checksum = md5(json_encode($articles));

$response = $this->response->withEtag($checksum);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}

Expand All @@ -894,14 +894,14 @@ Además, bajo el modelo de validación de caché HTTP, puede configurar el encab
fecha y hora en la que se modificó el recurso por última vez. Configurar este encabezado ayuda a CakePHP a decirle a los
clientes de almacenamiento en caché si la respuesta se modificó o no según su caché.

Para aprovechar este encabezado, debe llamar al método ``checkNotModified()`` manualmente o incluir
Para aprovechar este encabezado, debe llamar al método ``isNotModified()`` manualmente o incluir
:doc:`/controllers/components/check-http-cache` en su controlador::

public function view()
{
$article = $this->Articles->find()->first();
$response = $this->response->withModified($article->modified);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}
$this->response;
Expand All @@ -924,14 +924,14 @@ el encabezado ``Vary``::
Envío de respuestas no modificadas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. php:method:: checkNotModified(Request $request)
.. php:method:: isNotModified(Request $request)
Compara los encabezados de la caché del objeto de solicitud con el encabezado de la caché de la respuesta y determina
sitodavía se puede considerar nuevo. Si es así, elimina el contenido de la respuesta y envía el encabezado
`304 Not Modified`::

// En una acción del controlador.
if ($this->response->checkNotModified($this->request)) {
if ($this->response->isNotModified($this->request)) {
return $this->response;
}

Expand Down
12 changes: 6 additions & 6 deletions fr/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ correspond à une ressource du cache.

Pour réellement tirer profit de l'utilisation de cet en-tête, vous devez
soit appeler manuellement la méthode
``checkNotModified()`` ou inclure le
``isNotModified()`` ou inclure le
:doc:`/controllers/components/request-handling` dans votre controlleur::

public function index()
Expand All @@ -1008,7 +1008,7 @@ soit appeler manuellement la méthode
$checksum = md5(json_encode($articles));

$response = $this->response->withEtag($checksum);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}

Expand All @@ -1034,14 +1034,14 @@ ressource a été modifiée pour la dernière fois. Définir cet en-tête aide C
leur cache.

Pour réellement tirer profit de l'utilisation de cet en-tête, vous devez soit
appeler manuellement la méthode ``checkNotModified()`` ou inclure le
appeler manuellement la méthode ``isNotModified()`` ou inclure le
:doc:`/controllers/components/request-handling` dans votre controlleur::

public function view()
{
$article = $this->Articles->find()->first();
$response = $this->response->withModified($article->modified);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}
$this->response;
Expand All @@ -1065,14 +1065,14 @@ ressource. Dans ces circonstances, vous pouvez utiliser l'en-tête ``Vary``::
Envoyer des Réponses Non-Modifiées
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. php:method:: checkNotModified(Request $request)
.. php:method:: isNotModified(Request $request)
Compare les en-têtes de cache pour l'objet requêté avec l'en-tête du cache de
la réponse et determine s'il peut toujours être considéré comme à jour. Si oui,
il supprime le contenu de la réponse et envoie l'en-tête `304 Not Modified`::

// Dans une action de controller.
if ($this->response->checkNotModified($this->request)) {
if ($this->response->isNotModified($this->request)) {
return $this->response;
}

Expand Down
12 changes: 6 additions & 6 deletions ja/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ HTTP におけるキャッシュの検証はコンテンツが定期的に変化
リソースが一致するかどうかを調べるためにキャッシュはチェックサムを比較するでしょう。

実際にこのヘッダーを使うメリットを得るためには、手動で
``checkNotModified()`` メソッドを呼び出すかコントローラーに
``isNotModified()`` メソッドを呼び出すかコントローラーに
:doc:`/controllers/components/request-handling` を読み込まなければなりません。 ::

public function index()
Expand All @@ -938,7 +938,7 @@ HTTP におけるキャッシュの検証はコンテンツが定期的に変化
$checksum = md5(json_encode($articles));

$response = $this->response->withEtag($checksum);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}

Expand All @@ -961,14 +961,14 @@ HTTP キャッシュの検証モデルのもとでは、リソースが最後に
キャッシュしているクライアントにレスポンスが変更されたのかどうかを返答する手助けとなります。

実際にこのヘッダーを使うメリットを得るためには、
``checkNotModified()`` メソッドを呼び出すかコントローラーに
``isNotModified()`` メソッドを呼び出すかコントローラーに
:doc:`/controllers/components/request-handling` を読み込まなければなりません。 ::

public function view()
{
$article = $this->Articles->find()->first();
$response = $this->response->withModified($article->modified);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}
$this->response;
Expand All @@ -991,13 +991,13 @@ Vary ヘッダー
Not-Modified レスポンスの送信
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. php:method:: checkNotModified(Request $request)
.. php:method:: isNotModified(Request $request)
リクエストオブジェクトとレスポンスのキャッシュヘッダーを比較し、まだキャッシュが有効かどうかを決定します。
もしまだ有効な場合、レスポンスのコンテンツは削除され `304 Not Modified` ヘッダーが送られます。 ::

// コントローラーアクションの中で
if ($this->response->checkNotModified($this->request)) {
if ($this->response->isNotModified($this->request)) {
return $this->response;
}

Expand Down
12 changes: 6 additions & 6 deletions pt/controllers/request-response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -800,14 +800,14 @@ O método ``withEtag()`` (chamado tag de entidade) é uma string que identifica
o recurso solicitado, como a soma de verificação de um arquivo, para determinar se ele
corresponde a um recurso em cache.

Para tirar proveito desse cabeçalho, você deve chamar o método ``checkNotModified()``
Para tirar proveito desse cabeçalho, você deve chamar o método ``isNotModified()``
manualmente ou incluir o seguinte :doc:`/controllers/components/request-handling` no seu controlador::

public function index()
{
$articles = $this->Articles->find('all');
$response = $this->response->withEtag($this->Articles->generateHash($articles));
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}
$this->response = $response;
Expand All @@ -829,15 +829,15 @@ Além disso, no modelo de validação de cache HTTP, você pode definir o cabeç
pela última vez. Definir este cabeçalho ajuda o CakePHP a informar aos clientes
de armazenamento em cache se a resposta foi modificada ou não com base em seu cache.

Para tirar proveito desse cabeçalho, você deve chamar o método ``checkNotModified()``
Para tirar proveito desse cabeçalho, você deve chamar o método ``isNotModified()``
manualmente ou incluir o seguinte :doc:`/controllers/components/request-handling`
no seu controlador::

public function view()
{
$article = $this->Articles->find()->first();
$response = $this->response->withModified($article->modified);
if ($response->checkNotModified($this->request)) {
if ($response->isNotModified($this->request)) {
return $response;
}
$this->response;
Expand All @@ -860,14 +860,14 @@ dependendo do navegador. Nessas circunstâncias, você pode usar o cabeçalho ``
Enviando Respostas Não Modificadas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. php:method:: checkNotModified(Request $request)
.. php:method:: isNotModified(Request $request)
Compara os cabeçalhos de cache do objeto de solicitação com o cabeçalho de cache
da resposta e determina se ele ainda pode ser considerado novo. Nesse caso, exclui
o conteúdo da resposta e envia o cabeçalho `304 Not Modified`::

// Em um método do controlador.
if ($this->response->checkNotModified($this->request)) {
if ($this->response->isNotModified($this->request)) {
return $this->response;
}

Expand Down

0 comments on commit 97d83e1

Please sign in to comment.