It is currently impossible to specify a different client-side cache value than a server-side cache value when using both decorators *cache_control* and *cache_page* on a view.
For example: @cache_control(max_age=60) > @cache_page(timeout=3600) > def my_view(): > return HttpResponse() This would correctly return the header *Cache-Control: max-age=60 *but would cache the result, server-side, for 60 seconds instead of the requested 3600 seconds. The reason this happens is because *UpdateCacheMiddleware.process_response() *chooses the "*max-age" *header over any explicitly set *self.cache_timeout* value (i.e set from *CacheMiddleware* which *cache_page* uses). My immediate thought would be to have UpdateCacheMiddleware not initially set *self.cache_timeout* to *settings.CACHE_MIDDLEWARE_SECONDS* and then, in *process_response()*, only use "*max-age*" if *self.cache_timeout* was indeed *None*. I created the ticket https://code.djangoproject.com/ticket/30765. Any ideas if this would work? It seems too simple. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/009cce02-0d55-4a7c-b498-0490f04ba6a9%40googlegroups.com.