DISQUS

Code Spatter: How to Speed up Your Django Sites

  • Greg Allard · 8 months ago
    There are two more django apps that could help reduce http requests. I didn't find these until after posting this. http://code.google.com/p/django-sprites/ and http://github.com/rnk/django-media-bundler/tree... will help create image sprites so that your css background images are all one file request. CSS sprites are explained in more detail here http://alistapart.com/articles/sprites
  • Ben Bangert · 8 months ago
    Have you taken a look at Beaker? You can cache slow functionsthen, so that only parts of a request are cached as needed. It's easier to use with django now as well, I just blogged about it's use as a library on groovie.org
  • Greg Allard · 8 months ago
    I haven't gotten into caching and increasing performance of my application code itself; I was starting with the server. Thanks for the suggestion. When I do get around to speeding up slow parts of my code, I'll keep Beaker in mind.
  • JDStraughan · 8 months ago
    Added to http://tutlist.com

    Great tutorial.
  • Greg Allard · 8 months ago
    Thanks. I've never been to tutlist before. Sounds like a good idea.
  • Tim Rosenblatt · 8 months ago
    Great post, even for us non-Djangoers.

    One other tip on the serving-static-files thing: move them off your server entirely and don't even use the processing power. Store them on S3. From there, you can use the CDN and map multiple subdomains to the content, so you can spread your requests across multiple subdomains.

    The reason for this is that web browsers will not open more than N connections to a given domain. Mapping them across multiple subdomains means that an image/static-heavy page will open even more connections and load concurrently.
  • Greg Allard · 8 months ago
    Yeah amazon's content distribution network is awesome and not a bad price. I'd like to hook that up sometime soon. I didn't know that subdomains would help with the browser limit. That's a good idea.
  • Greg Allard · 8 months ago
    I just installed django-memcache-status to see the usage of memcache in the django admin interface. It looks pretty good and it's easy to install. Just download it and add it to installed apps. http://github.com/bartTC/django-memcache-status/