Skip to content
EXPERIMENTAL/ALPHA. Transparently caches the results of SQL SELECT statements.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


= Django Query Caching =
Caches the results of SQL queries transparently.
FYI, this isn't complete yet, there's probably still a lot of bugs.
Also, this whole project might just be a bad idea since it caches everything. I'll probably add options for excluding tables and limiting the size of queries that can be cached. Even then, testing will need to be done to make sure this actually speeds things up.
This project was developed using Django 1.2.1.

= Usage =
Place this directory in your Django project or on your Python path, then add 'django_query_caching' to your INSTALLED_APPS. That's it.

= Why? =
I'd written a CachedManager implementation that caches whole QuerySets, but it was really only good for doing things like MyModel.objects.all(). filter() and the other methods would still hit the database (writing custom filter() and exclude() methods to iterate over the whole cached QuerySet wouldn't be practical), as would anything to do with a RelatedManager. Using the Django Debug Toolbar, I also noticed that the same queries were sometimes being executed 2-3 times per page load, because they were occurring in separate parts of my application and the built in QuerySet cache isn't shared across instances. I decided the simplest way to solve all these problems at once was to cache the results of the SQL statements themselves.

= Contributing =
You can fork this project on GitHub:

= License =
This project is licensed under the BSD License.

== Links ==

== Alternatives ==

You can’t perform that action at this time.