code: function(evt) {
          if (this.active) {
              var tile = evt.tile;
              if (tile instanceof OpenLayers.Tile.Image &&
                      !tile.crossOriginKeyword &&
                      tile.url.substr(0, 5) !== "data:") {
                  var sameOriginUrl = OpenLayers.Request.makeSameOrigin(
                      tile.url, OpenLayers.ProxyHost
                  );
                  OpenLayers.Control.CacheWrite.urlMap[sameOriginUrl] = tile.url;
                  tile.url = sameOriginUrl;
              }
          }
      }
docs: Method: makeSameOrigin
  If the tile does not have CORS image loading enabled and is from a
  different origin, use OpenLayers.ProxyHost to make it a same origin url.
  
  Parameters:
  evt - {<OpenLayers.Event>}