title: Cache function or view?
body: <p>I want to use <code>django-rest-framework</code> with cache.</p>
  <pre><code>@cache_page(10 * 60)
  @api_view(['GET'])
  def get_num(request):
      if request.method == &quot;GET&quot;:
          res = [&quot;ok&quot;]
          return Response(res)
  </code></pre>
  <p>It works well.</p>
  <p>So actually I want to cache not <code>view</code> but <code>function</code></p>
  <pre><code>@cache_page(10 * 60)
  def getCalc(num):
      return num * 10
  
  
  @api_view(['GET'])
  def get_num(request):
      if request.method == &quot;GET&quot;:
          res = getCalc(request.query_params.get('num'))
          return Response(res)
  </code></pre>
  <p>There comes error <code>TypeError: _wrapped_view() missing 1 required positional argument: 'request'</code></p>
  <p>Is it possible to use cache for <code>function</code>??</p>