python - In Django, can I set vary_on_cookie globally? -
when developing django app, can use vary_on_cookie decorator make sure upstream caches use session cookie in addition url distinguish between different pages.
i have lot of view functions , of them require header. possible specify behavior once (maybe in settings file entire site or @ least entire app)? or have repeat decorator in front of every single view function?
thank help...
sounds want write own middleware , modify each request include headers want included on each request.
creating middleware easy , interested in process_response method, can modify response , you're done.
to modify headers of httpresponse check out docs here.
Comments
Post a Comment