How to integrate 304 into Django?

When a user requests the same page with the same data ... I would like Django to return 304 so that the browser does not load the page again.

I am new to this. How can I do that?

Thanks.

+5
source share
2 answers

Detailed description in Django documentation: Handling conditional viewing

The following tools are especially useful:

  • @last_modifiedand @etagview decorators. You provide them with a function to calculate the value from the query, and everything else is done automatically.
  • django.middleware.http.ConditionalGetMiddleware - ETag 304, , HTML , . .
+12

All Articles