title: How to cache Django rest framework generics.ListAPIView response
body: <p>models.py</p>
  <pre><code>class PaymentMode(models.Model):
      name = models.CharField(max_length=20)
      icon = models.CharField(max_length=350, default='', null=True)
  </code></pre>
  <p>serializer.py</p>
  <pre><code>class PaymentModeSerializer(serializers.ModelSerializer):
      class Meta:
          model = PaymentMode
          fields ='__all__'
  </code></pre>
  <p>Views.py</p>
  <pre><code>
  class PaymentModesList(generics.ListAPIView):
      queryset = PaymentMode.objects.all()
      serializer_class = PaymentModeSerializer
  </code></pre>
  <p><a href="https://www.django-rest-framework.org/api-guide/caching/" rel="nofollow noreferrer">URL to DRFcaching documentation</a></p>
  <p>can someone please help me with how I can cache this response and not do a query as I think this response will be the same for all user for a vast majority of the time.</p>