K
K
kAIST2020-09-08 17:33:23
Django
kAIST, 2020-09-08 17:33:23

How to cache in django depending on HTTP_ACCEPT?

In my page templates, they are given depending on the HTTP_ACCEPT header (two cases: does the browser understand images in webp or not). I caught a bug for a long time, why sometimes (!!!) photos are not visible on iOS, and I realized that the problem is in the cache, where pages with webp images get, and it dawned on me that the page just got into the cache.
How can I cache them separately?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-09-08
@tumbler

By default, pages in Django are not cached. Add the Accept header to your caching settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question