docs: def get_content(request):
      """Retrieve content using the ident-hash (uuid@version).
  
      Depending on extension or HTTP_ACCEPT header return HTML or JSON.
      """
      ext = request.matchdict.get('ext')
      accept = request.headers.get('ACCEPT', '')
      if not ext:
          if ('application/xhtml+xml' in accept):
              result, resp = get_content_html(request)
          else:  # default to json
              result, resp = get_content_json(request)
      elif ext == '.html':
          result, resp = get_content_html(request)
      elif ext == '.json':
          result, resp = get_content_json(request)
      else:
          raise httpexceptions.HTTPNotFound()
  
      if result['stateid'] not in [1, 8]:
          # state 1 = current, state 8 = fallback
          cc = resp.cache_control
          cc.prevent_auto = True
          cc.no_cache = True
          cc.no_store = True
          cc.must_revalidate = True
      else:
          resp.cache_control.public = True
  
      # Build the canonical link
      resp.headerlist.append(
              ('Link', '<{}> ;rel="Canonical"'.format(result['canon_url'])))
  
      return resp