Skip to content Skip to sidebar Skip to footer

What Steps Are Needed To Implement Memcached In A Django Application?

I have my existing Django web application that uses a MySQLDB without memcaching. I would like to implement memcaching to improve the responsiveness of this site. I see the instruc

Solution 1:

What you've done is just a set up of a Cache Backend.

In order to benefit from caching you need to find the places where it is appropriate and would have a positive impact on performance: your views, templates..you can cache the whole views, templates, template fragments etc.

If you want some automation to help you, take a look at Johnny Cache package:

Johnny Cache is a caching framework for django applications. It works with the django caching abstraction, but was developed specifically with the use of memcached in mind. Its main feature is a patch on Django’s ORM that automatically caches all reads in a consistent manner.

Or django-cache-machine package:

Cache Machine provides automatic caching and invalidation for Django models through the ORM.

There is also an interesting project called django-cacheops that is aiming to improve Django ORM caching, but it uses Redis backend.

Also, django_debug_toolbars caching panel can help you in the future.

Note that django querysets have a built-in internal cache, but it has nothing to do with a cache framework.

Further reading:

Post a Comment for "What Steps Are Needed To Implement Memcached In A Django Application?"