raksha-life / rescuekerala

Website for coordinating rehabilitation of people affected in the Kerala Floods
https://keralarescue.in
MIT License
676 stars 575 forks source link

Fix #1030. Display volunteer count on home page #1036

Open jerinisready opened 5 years ago

jerinisready commented 5 years ago

COMMIT ensures there is no breaking in design or working of the application.

CHANGES

Date: Sat Aug 10 12:47:58 2019 +0530 On branch 2019/jerinisready/issue_fix

Changes to be committed:

Issue Reference

This PR addresses the Issue: Fixes #1030

Summarize

Added badges to cards which shows count of active items in that section.

Updations

OPTIMIZATIONS.
  * Usage of Redis cache to avoid DB hits first hit strike 12 querys to get data. 

After caching on first hit, it take none until cache expiry.

CONFIGURATIONS.
HOME_PAGE_ANALYTICS = {
    'DISPLAY': True,
    'INVALIDATION_LOGIC': 'TIMEOUT',        # options : ["TIMEOUT", "ON_CREATE"] ## ON_CREATE is accurate but expensive for drastic write COUNT.
    'TIMEOUT': 60 * 40,                     # DEFAULTS TO 40 MINUTE.
    'HOME_PAGE_CACHE_KEY': 'home_page_data_statics',
    'VOLUNTEER_CACHE_KEY': 'ngo_data_statics',
}
while coding reviews

new_home