code: func (h *Handler) lookup(req *cacheRequest) (*Resource, error) {
  	res, err := h.cache.Retrieve(req.Key.String())
  
  	// HEAD requests can possibly be served from GET
  	if err == ErrNotFoundInCache && req.Method == "HEAD" {
  		res, err = h.cache.Retrieve(req.Key.ForMethod("GET").String())
  		if err != nil {
  			return nil, err
  		}
  
  		if res.HasExplicitExpiration() && req.isCacheable() {
  			debugf("using cached GET request for serving HEAD")
  			return res, nil
  		} else {
  			return nil, ErrNotFoundInCache
  		}
  	} else if err != nil {
  		return res, err
  	}
  
  	// Secondary lookup for Vary
  	if vary := res.Header().Get("Vary"); vary != "" {
  		res, err = h.cache.Retrieve(req.Key.Vary(vary, req.Request).String())
  		if err != nil {
  			return res, err
  		}
  	}
  
  	return res, nil
  }
docs: // lookupResource finds the best matching Resource for the
  // request, or nil and ErrNotFoundInCache if none is found