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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -