docs: function(config) {
              var conf = config || {},
                  x = conf.x || 0,
                  y = conf.y || 0,
                  width = conf.width || this.width(),
                  height = conf.height || this.height(),
                  drawBorder = conf.drawBorder || false,
                  layer = this.getLayer();
              if (width === 0 || height === 0) {
                  Kinetic.Util.warn('Width or height of caching configuration equals 0. Cache is ignored.');
                  return;
              }
              var cachedSceneCanvas = new Kinetic.SceneCanvas({
                      pixelRatio: 1,
                      width: width,
                      height: height
                  }),
                  cachedFilterCanvas = new Kinetic.SceneCanvas({
                      pixelRatio: 1,
                      width: width,
                      height: height
                  }),
                  cachedHitCanvas = new Kinetic.HitCanvas({
                      width: width,
                      height: height
                  }),
                  origTransEnabled = this.transformsEnabled(),
                  origX = this.x(),
                  origY = this.y(),
                  sceneContext = cachedSceneCanvas.getContext(),
                  hitContext = cachedHitCanvas.getContext();
  
              this.clearCache();
     
              sceneContext.save();
              hitContext.save();
  
              // this will draw a red border around the cached box for
              // debugging purposes
              if (drawBorder) {        
                  sceneContext.save();
                  sceneContext.beginPath();
                  sceneContext.rect(0, 0, width, height);
                  sceneContext.closePath();
                  sceneContext.setAttr('strokeStyle', 'red');
                  sceneContext.setAttr('lineWidth', 5);
                  sceneContext.stroke();
                  sceneContext.restore();
              }
  
              sceneContext.translate(x * -1, y * -1);
              hitContext.translate(x * -1, y * -1);
  
              if (this.nodeType === 'Shape') {
                  sceneContext.translate(this.x() * -1, this.y() * -1);
                  hitContext.translate(this.x() * -1, this.y() * -1);        
              }
  
              this.drawScene(cachedSceneCanvas, this);
              this.drawHit(cachedHitCanvas, this);
  
              sceneContext.restore();
              hitContext.restore();
  
              this._cache.canvas = {
                  scene: cachedSceneCanvas,
                  filter: cachedFilterCanvas,
                  hit: cachedHitCanvas
              };
  
              return this;
          }