From 378d9e8abf73a67183acbe2d6844b0871a2b32ca Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Sat, 16 Mar 2019 07:50:40 +0100 Subject: [PATCH] be keen to newcomers --- .../http_kernel_httpkernelinterface.rst | 17 ++++++++--------- forms.rst | 8 ++++---- http_cache/esi.rst | 2 +- http_cache/expiration.rst | 8 ++++---- http_cache/validation.rst | 10 +++++----- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/create_framework/http_kernel_httpkernelinterface.rst b/create_framework/http_kernel_httpkernelinterface.rst index 350b1291716..ed1870706fd 100644 --- a/create_framework/http_kernel_httpkernelinterface.rst +++ b/create_framework/http_kernel_httpkernelinterface.rst @@ -90,11 +90,10 @@ to cache a response for 10 seconds, use the ``Response::setTtl()`` method:: .. tip:: - If, like me, you are running your framework from the command line by - simulating requests (``Request::create('/is_leap_year/2012')``), you can - easily debug Response instances by dumping their string representation - (``echo $response;``) as it displays all headers as well as the response - content. + If you are running your framework from the command line by simulating + requests (``Request::create('/is_leap_year/2012')``), you can debug + Response instances by dumping their string representation (``echo $response;``) + as it displays all headers as well as the response content. To validate that it works correctly, add a random number to the response content and check that the number only changes every 10 seconds:: @@ -114,8 +113,8 @@ comfortable with these concepts, read the `HTTP caching`_ chapter of the Symfony documentation. The Response class contains many other methods that let you configure the -HTTP cache very easily. One of the most powerful is ``setCache()`` as it -abstracts the most frequently used caching strategies into one simple array:: +HTTP cache. One of the most powerful is ``setCache()`` as it abstracts the +most frequently used caching strategies into one array:: $date = date_create_from_format('Y-m-d H:i:s', '2005-10-15 10:00:00'); @@ -135,8 +134,8 @@ abstracts the most frequently used caching strategies into one simple array:: $response->setSharedMaxAge(10); When using the validation model, the ``isNotModified()`` method allows you to -easily cut on the response time by short-circuiting the response generation as -early as possible:: +cut on the response time by short-circuiting the response generation as early +as possible:: $response->setETag('whatever_you_compute_as_an_etag'); diff --git a/forms.rst b/forms.rst index 7f69f7b0ec7..f66561215e9 100644 --- a/forms.rst +++ b/forms.rst @@ -178,7 +178,7 @@ That's it! Just three lines are needed to render the complete form: .. seealso:: - As easy as this is, it's not very flexible (yet). Usually, you'll want to + As short as this is, it's not very flexible (yet). Usually, you'll want to render each form field individually so you can control how the form looks. You'll learn how to do that in the ":doc:`/form/rendering`" section. @@ -611,9 +611,9 @@ be used to quickly build a form object in the controller:: // ... } -Placing the form logic into its own class means that the form can be easily -reused elsewhere in your project. This is the best way to create forms, but -the choice is ultimately up to you. +Placing the form logic into its own class means that the form can be reused +elsewhere in your project. This is the best way to create forms, but the +choice is ultimately up to you. .. _form-data-class: diff --git a/http_cache/esi.rst b/http_cache/esi.rst index c9912e2c090..a6633089238 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -250,6 +250,6 @@ The ``render_esi`` helper supports two other useful options: ``ignore_errors`` If set to true, an ``onerror`` attribute will be added to the ESI with a value of ``continue`` indicating that, in the event of a failure, the gateway cache - will simply remove the ESI tag silently. + will remove the ESI tag silently. .. _`ESI`: http://www.w3.org/TR/esi-lang diff --git a/http_cache/expiration.rst b/http_cache/expiration.rst index 639ea7c39b5..fa770a4fd29 100644 --- a/http_cache/expiration.rst +++ b/http_cache/expiration.rst @@ -15,10 +15,10 @@ HTTP headers: ``Expires`` or ``Cache-Control``. .. sidebar:: Expiration and Validation You can of course use both validation and expiration within the same ``Response``. - As expiration wins over validation, you can easily benefit from the best of - both worlds. In other words, by using both expiration and validation, you - can instruct the cache to serve the cached content, while checking back - at some interval (the expiration) to verify that the content is still valid. + As expiration wins over validation, you can benefit from the best of both worlds. + In other words, by using both expiration and validation, you can instruct the cache + to serve the cached content, while checking back at some interval (the expiration) + to verify that the content is still valid. .. tip:: diff --git a/http_cache/validation.rst b/http_cache/validation.rst index 7951cb7d618..7cb99345aad 100644 --- a/http_cache/validation.rst +++ b/http_cache/validation.rst @@ -23,7 +23,7 @@ page again (see below for an implementation example). The 304 status code means "Not Modified". It's important because with this status code the response does *not* contain the actual content being - requested. Instead, the response is simply a light-weight set of directions that + requested. Instead, the response is a light-weight set of directions that tells the cache that it should use its stored version. Like with expiration, there are two different HTTP headers that can be used @@ -32,10 +32,10 @@ to implement the validation model: ``ETag`` and ``Last-Modified``. .. sidebar:: Expiration and Validation You can of course use both validation and expiration within the same ``Response``. - As expiration wins over validation, you can easily benefit from the best of - both worlds. In other words, by using both expiration and validation, you - can instruct the cache to serve the cached content, while checking back - at some interval (the expiration) to verify that the content is still valid. + As expiration wins over validation, you can benefit from the best of both worlds. + In other words, by using both expiration and validation, you can instruct the cache + to serve the cached content, while checking back at some interval (the expiration) + to verify that the content is still valid. .. tip::