Search code examples
djangocachingcache-control

Does Django per-view cache add HTTP headers?


In the case of the per-site cache there are some headers added: Last-Modified, Cache-Control, etc. See Django per-site cache.

I was wondering if Django also adds them for the per-view cache. If not, is there a straightforward way to tell Django to add them?


Solution

  • Yes, it just applies UpdateCacheMiddleware and FetchFromCacheMiddleware to a specific view.