Caching in JSON Response of DRF and also add/edit the objects in cache if new object is created/edited

17 views
Skip to first unread message

Jai

unread,
Aug 25, 2017, 11:22:28 AM8/25/17
to Django REST framework
I want to do an effective caching in JSON response of generic cache either in Memcache or Database Caching.
But I want to change the cache if an object is newly created(add the object name and id to JSON Response) and edit the object. As the TTL of cache is 1 day, so the cache will update in 1 day, but I wanted to modify the cache if an object is created, edited or deleted.
I am using this JSON response to search the objects via Jquery Autocomplete, but my total objects JSON size is over 1.2 MB, so it loads on every request, but I want to cache this to reduce server response time.
Help me, or correct me if I am doing wrong.

Reply all
Reply to author
Forward
0 new messages