8000 Merge branch '2.3' into 2.5 · symfony/symfony-docs@98e6c09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 98e6c09

Browse files
committed
Merge branch '2.3' into 2.5
* 2.3: Revert ""Revert "Added config example for Varnish 4.0"""" Yay for latin abbreviations Inline condition removed for easier reading One more again. I could have sworn I had them lined up. Removed the possession from Doctrine. Shorten the = to match the length of the text. Removed the redundant usage of layer.
2 parents de286e2 + 490ca6b commit 98e6c09

File tree

4 files changed

+58
-25
lines changed

4 files changed

+58
-25
lines changed

book/service_container.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ looks up the value of each parameter and uses it in the service definition.
218218
.. note::
219219

220220
If you want to use a string that starts with an ``@`` sign as a parameter
221-
value (i.e. a very safe mailer password) in a YAML file, you need to escape
221+
value (e.g. a very safe mailer password) in a YAML file, you need to escape
222222
it by adding another ``@`` sign (this only applies to the YAML format):
223223

224224
.. code-block:: yaml

cookbook/cache/varnish.rst

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,30 +54,62 @@ Then, optimize Varnish so that it only parses the Response contents when there
5454
is at least one ESI tag by checking the ``Surrogate-Control`` header that
5555
Symfony adds automatically:
5656

57-
.. code-block:: text
57+
.. configuration-block::
5858

59-
sub vcl_fetch {
60-
/*
61-
Check for ESI acknowledgement
62-
and remove Surrogate-Control header
63-
*/
64-
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
65-
unset beresp.http.Surrogate-Control;
59+
.. code-block:: varnish4
6660
67-
// For Varnish >= 3.0
68-
set beresp.do_esi = true;
69-
// For Varnish < 3.0
70-
// esi;
61+
/* (https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html#req-not-available-in-vcl-backend-response) */
62+
sub vcl_backend_response {
63+
// Check for ESI acknowledgement and remove Surrogate-Control header
64+
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
65+
unset beresp.http.Surrogate-Control;
66+
set beresp.do_esi = true;
67+
}
68+
/* By default Varnish ignores Pragma: nocache
69+
(https://www.varnish-cache.org/docs/4.0/users-guide/increasing-your-hitrate.html#cache-control)
70+
so in order avoid caching it has to be done explicitly */
71+
if (beresp.http.Pragma ~ "no-cache") {
72+
// https://www.varnish-cache.org/docs/4.0/whats-new/upgrading.html#hit-for-pass-objects-are-created-using-beresp-uncacheable
73+
set beresp.uncacheable = true;
74+
set beresp.ttl = 120s;
75+
return (deliver);
76+
}
7177
}
72-
/* By default Varnish ignores Cache-Control: nocache
73-
(https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control),
74-
so in order avoid caching it has to be done explicitly */
75-
if (beresp.http.Pragma ~ "no-cache" ||
76-
beresp.http.Cache-Control ~ "no-cache" ||
77-
beresp.http.Cache-Control ~ "private") {
78-
return (hit_for_pass);
78+
79+
.. code-block:: varnish3
80+
81+
sub vcl_fetch {
82+
// Check for ESI acknowledgement and remove Surrogate-Control header
83+
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
84+
unset beresp.http.Surrogate-Control;
85+
set beresp.do_esi = true;
86+
}
87+
/* By default Varnish ignores Cache-Control: nocache
88+
(https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control),
89+
so in order avoid caching it has to be done explicitly */
90+
if (beresp.http.Pragma ~ "no-cache" ||
91+
beresp.http.Cache-Control ~ "no-cache" ||
92+
beresp.http.Cache-Control ~ "private") {
93+
return (hit_for_pass);
94+
}
95+
}
96+
97+
.. code-block:: varnish2
98+
99+
sub vcl_fetch {
100+
// Check for ESI acknowledgement and remove Surrogate-Control header
101+
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
102+
unset beresp.http.Surrogate-Control;
103+
esi;
104+
}
105+
/* By default Varnish ignores Cache-Control: nocache
106+
so in order avoid caching it has to be done explicitly */
107+
if (beresp.http.Pragma ~ "no-cache" ||
108+
beresp.http.Cache-Control ~ "no-cache" ||
109+
beresp.http.Cache-Control ~ "private") {
110+
return (hit_for_pass);
111+
}
79112
}
80-
}
81113
82114
.. caution::
83115

cookbook/doctrine/dbal.rst

Lines changed: 3 additions & 3 deletions
pair: Doctrine; DBAL
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. index::
22
33

4-
How to Use Doctrine's DBAL Layer
5-
================================
4+
How to Use Doctrine DBAL
5+
========================
66

77
.. note::
88

9-
This article is about Doctrine DBAL's layer. Typically, you'll work with
9+
This article is about the Doctrine DBAL. Typically, you'll work with
1010
the higher level Doctrine ORM layer, which simply uses the DBAL behind
1111
the scenes to actually communicate with the database. To read more about
1212
the Doctrine ORM, see ":doc:`/book/doctrine`".

cookbook/doctrine/file_uploads.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
404404
*/
405405
public function removeUpload()
406406
{
407-
if ($file = $this->getAbsolutePath()) {
407+
$file = $this->getAbsolutePath();
408+
if ($file) {
408409
unlink($file);
409410
}
410411
}

0 commit comments

Comments
 (0)
0