V
V
Valery Semenov2012-10-28 15:18:20
Django
Valery Semenov, 2012-10-28 15:18:20

What are the packages for caching in django?

it is desirable that:
- be able to save to files (so that nginx can be set on them)
- have tags (so that the tags can be used to find the cached content and deal with it if the associated object changes)
- used quite carefully (for example, through a decorator)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
a11aud, 2012-10-28
@Ravall

It is not entirely clear what you are looking for, but I will answer as follows:
- Django has a built-in caching mechanism with several standard backends for it - FileBackend, MemcacheBackend, DatabaseBackend (I could have confused the names, but the essence is the same). You choose whether to enable the cache and which backend to use in the settings (settings.py).
Keep in mind that for the convenience of development, it is most convenient to use DummyBackend, and you can read the full information in the documentation
- If you need to cache a large number of querysets and it is possible to use Redis, then I recommend looking towards solutions with automatic invalidation. I consider cacheops one of the best such tools , by the way, the author is our compatriot and has already writtenabout it on Habré.

U
un1t, 2012-10-28
@un1t

Junga has caching mechanisms, as mentioned above. In a couple of projects, we used the following methodology. The site was raised on jang, wget was recursively set on it, and the entire site was downloaded as html files and deployed to production in this form. It is clear that this was a simple promo site without any authorizations and other things that require interaction with the backend. In general, in most of our projects, djanga keeps the load without any caching. The latest project holds 150,000 people a day with no cache at all. True, we usually do not have very large data volumes.

M
MechanisM, 2012-10-29
@MechanisM

See also django-cacheback for asynchronous cache flushing using tasks in celery.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question