Break long lines in OutputPage::sendCacheControl()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 3 Nov 2016 20:06:59 +0000 (13:06 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 3 Nov 2016 20:06:59 +0000 (13:06 -0700)
Change-Id: I72d494f4c97aef9d500bb5d7b36dad30a44f501a

includes/OutputPage.php

index 863a426..bf59c9a 100644 (file)
@@ -2198,22 +2198,26 @@ class OutputPage extends ContextSource {
                                        # We'll purge the proxy cache explicitly, but require end user agents
                                        # to revalidate against the proxy on each visit.
                                        # Surrogate-Control controls our CDN, Cache-Control downstream caches
-                                       wfDebug( __METHOD__ . ": proxy caching with ESI; {$this->mLastModified} **", 'private' );
+                                       wfDebug( __METHOD__ .
+                                               ": proxy caching with ESI; {$this->mLastModified} **", 'private' );
                                        # start with a shorter timeout for initial testing
                                        # header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
-                                       $response->header( 'Surrogate-Control: max-age=' . $config->get( 'SquidMaxage' )
-                                               . '+' . $this->mCdnMaxage . ', content="ESI/1.0"' );
+                                       $response->header(
+                                               "Surrogate-Control: max-age={$config->get( 'SquidMaxage' )}" .
+                                               "+{$this->mCdnMaxage}, content=\"ESI/1.0\""
+                                       );
                                        $response->header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
                                } else {
                                        # We'll purge the proxy cache for anons explicitly, but require end user agents
                                        # to revalidate against the proxy on each visit.
                                        # IMPORTANT! The CDN needs to replace the Cache-Control header with
                                        # Cache-Control: s-maxage=0, must-revalidate, max-age=0
-                                       wfDebug( __METHOD__ . ": local proxy caching; {$this->mLastModified} **", 'private' );
+                                       wfDebug( __METHOD__ .
+                                               ": local proxy caching; {$this->mLastModified} **", 'private' );
                                        # start with a shorter timeout for initial testing
                                        # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
-                                       $response->header( 'Cache-Control: s-maxage=' . $this->mCdnMaxage
-                                               . ', must-revalidate, max-age=0' );
+                                       $response->header( "Cache-Control: " .
+                                               "s-maxage={$this->mCdnMaxage}, must-revalidate, max-age=0" );
                                }
                        } else {
                                # We do want clients to cache if they can, but they *must* check for updates