Cookieless domains for static in Django + Nginx

162 Views Asked by At

I've found a tip of using cookieless domains for serving static files. My experiments have shown seriuos drop in request time (django-debug-toolbar) that is pretty much what I wanted to get.

The problem is that I want to add 'http://static.xxxxx.com' to each static file request (e.g. <img src="http://static.xxxxx.com/..."/>, but hold all the files at the same place as they are now (using CNAME).

However I'm not sure about what should I change in production: either nginx conf or django settings.. I've tried changing STATIC_URL adding http://static.xxxxxx.com, but in vain - everything has crushed.

Could you help me with an advice?

Thanks in advance and have a nice day

0

There are 0 best solutions below