Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c0c5d1

Browse files
committed
minorsymfony#3653 Http cache validation rewording (weaverryan)
This PR was merged into the 2.3 branch.Discussion----------Http cache validation rewordingHiya guys!This comes aftersymfony#3596.I realized that the sentence on the notes was a bid hard to read. I also removed a usage ofthe word "client" right before this, so I can use the word "cache" instead (meaning, I wantthe user to be thinking about the reverse proxy, not a user's browser cache - that's valid,but not the typical use-case).| Q | A| ------------- | ---| Doc fix? | yes| New docs? | no| Applies to | all| Fixed tickets | -Thanks!Commits-------a7cdfe9 [symfony#3596] Tweaking language on HTTP cache
2 parents0fb2c5f +a7cdfe9 commit7c0c5d1

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

‎book/http_cache.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,9 @@ the application whether or not the cached response is still valid. If the
526526
cache *is* still valid, your application should return a 304 status code
527527
and no content. This tells the cache that it's ok to return the cached response.
528528

529-
Under this model, you mainly save bandwidth as the representation is not
530-
sent twice to the same client (a 304 response is sent instead). But if you
531-
design your application carefully, you might be able to get the bare minimum
532-
data needed to send a 304 response and save CPU also (see below for an implementation
533-
example).
529+
Under this model, you only save CPU if you're able to determine that the
530+
cached response is still valid by doing *less* work than generating the whole
531+
page again (see below for an implementation example).
534532

535533
..tip::
536534

@@ -578,10 +576,10 @@ automatically sets the ``Response`` status code to 304.
578576

579577
..note::
580578

581-
The ``If-None-Match``requestheaderequals the ``ETag`` header of the
582-
last response sent to the client for theparticular resource. This is
583-
how theclient and server communicate with each other and decide whether
584-
or not the resource has been updated since it was cached.
579+
Thecache sets the``If-None-Match`` headeron therequest to the``ETag``
580+
of the original cached response before sending therequest back to the
581+
app. This ishow thecache and server communicate with each other and
582+
decide whetheror not the resource has been updated since it was cached.
585583

586584
This algorithm is simple enough and very generic, but you need to create the
587585
whole ``Response`` before being able to compute the ETag, which is sub-optimal.
@@ -646,10 +644,10 @@ the ``Response`` will be set to a 304 status code.
646644

647645
..note::
648646

649-
The ``If-Modified-Since``requestheaderequals the ``Last-Modified``
650-
headerof thelastresponsesent to theclient for the particular resource.
651-
This is how theclient and server communicate with each other and decide
652-
whether or not the resource has been updated since it was cached.
647+
Thecache sets the``If-Modified-Since`` headeron the request to the ``Last-Modified``
648+
of theoriginal cachedresponsebefore sending therequest back to the
649+
app.This is how thecache and server communicate with each other and
650+
decidewhether or not the resource has been updated since it was cached.
653651

654652
..index::
655653
single: Cache; Conditional get

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp