Bhupesh-V / tutorialdb

A search 🔎 engine for programming/dev tutorials,
MIT License
124 stars 62 forks source link

Implemented the caching db query for tags page #38

Closed vikneswaran20 closed 4 years ago

vikneswaran20 commented 5 years ago
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': '127.0.0.1:11211',
    }
}
Animesh-Ghosh commented 4 years ago

How did you setup the cache?

vikneswaran20 commented 4 years ago

Currently I have implemented the in memory cache provided by Django by default. No need to setup any external cache. If we need we can setup memcached or redis separately and configure it in django

Animesh-Ghosh commented 4 years ago

I meant did you run any Django manage.py commands? Never did caching before in Django that's why I'm asking :sweat_smile:.

vikneswaran20 commented 4 years ago

No not needed. Just see caching as some thing like how you connect database. Now I used Django’s inbuilt cache which is some thing like using sqlite, no additional configuration needed. Later we can extend it to the PostgreSQL or MySQL. Similarly if we implement cache, later we can also extend the inbuilt cache to external caching system like redis or memcahed. I just used DB here for analogy to understand how to implement caching in django.

Bhupesh-V commented 4 years ago

@vikneswaran20 thanks a lot for this PR :heart_decoration: , sorry for the late merge have been busy :sweat_smile:

Bhupesh-V commented 4 years ago

@all-contributors please add @vikneswaran20 for code

allcontributors[bot] commented 4 years ago

@Bhupesh-V

I've put up a pull request to add @vikneswaran20! :tada: