Since i'm new to django-cache, I was trying to cache a particular view in Django. I'm not sure whether the data is fetched from cache or from the database. How do I verify that? Being a newbie, kindly also check that I'm caching the view correctly or not?
Views.py
@cache_page(900)
def dashboard(request):
__something__
Settings.py
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
CACHE_MIDDLEWARE_ALIAS = 'default'
CACHE_MIDDLEWARE_SECONDS = 600