I've seen all over problems using Memcached in Django projects which is considered to be
The fastest, most efficient type of cache supported natively by Django
For instances,
- Why doesn't memcache work in my Django?
- How to configure Memcache for Django on Google cloud AppEngine?
- Django doesn't use memcached framework
- memcache on django is not working
- How to use memcached in django project?
- How do you confirm django is using memcached?
- Configuring memcached with django
- What steps are needed to implement memcached in a Django application?
- How to use memcached in django project?
So, how can we then use it?
This answer explains how to install Memcached on Windows 10 and how to integrate it with Django through a specific client. It was validated using Memcached 1.4.4, Python 2.7 and Django 1.11.
In your Django project, under settings.py, add the following code in the bottom of the file
Install memcached client for Python with your virtual environment active (python-memcached)
Download Memcached using one of the following download links and extract it to a particular folder
Open that folder location in the Terminal or PowerShell and run
you should get something like this
Run the following command (-m is for the amount of memory you want to dedicate and -vvv is for extreme verbose)
In the view you want to use cache, specify it in urls.py like
Go to the Django project, start the server and you should get much better results in your Time load.