Merge "Replace "squid" with "CDN" in various comments"
[lhc/web/wiklou.git] / includes / AjaxResponse.php
index 6c2efc2..db989a4 100644 (file)
@@ -175,14 +175,14 @@ class AjaxResponse {
                }
 
                if ( $this->mCacheDuration ) {
-                       # If squid caches are configured, tell them to cache the response,
-                       # and tell the client to always check with the squid. Otherwise,
+                       # If CDN caches are configured, tell them to cache the response,
+                       # and tell the client to always check with the CDN. Otherwise,
                        # tell the client to use a cached copy, without a way to purge it.
 
                        if ( $this->mConfig->get( 'UseSquid' ) ) {
                                # Expect explicit purge of the proxy cache, but require end user agents
                                # to revalidate against the proxy on each visit.
-                               # Surrogate-Control controls our Squid, Cache-Control downstream caches
+                               # Surrogate-Control controls our CDN, Cache-Control downstream caches
 
                                if ( $this->mConfig->get( 'UseESI' ) ) {
                                        header( 'Surrogate-Control: max-age=' . $this->mCacheDuration . ', content="ESI/1.0"' );
@@ -276,13 +276,11 @@ class AjaxResponse {
         * @return bool
         */
        function loadFromMemcached( $mckey, $touched ) {
-               global $wgMemc;
-
                if ( !$touched ) {
                        return false;
                }
 
-               $mcvalue = $wgMemc->get( $mckey );
+               $mcvalue = ObjectCache::getMainWANInstance()->get( $mckey );
                if ( $mcvalue ) {
                        # Check to see if the value has been invalidated
                        if ( $touched <= $mcvalue['timestamp'] ) {
@@ -304,9 +302,7 @@ class AjaxResponse {
         * @return bool
         */
        function storeInMemcached( $mckey, $expiry = 86400 ) {
-               global $wgMemc;
-
-               $wgMemc->set( $mckey,
+               ObjectCache::getMainWANInstance()->set( $mckey,
                        array(
                                'timestamp' => wfTimestampNow(),
                                'value' => $this->mText