Cache Memory

This page describes how the cached data is shown to the user and at what cases this cached data is recalculated.

At the outset, Bolbhav displays crop price data sourced from the cached payload. This payload corresponds to the unique combination of the selected crop, mandi, and date chosen by the user. The application leverages this cached payload to promptly present users with the most recent and relevant mandi prices.

Dynamic Recalculation of Cached Payload

Bolbhav dynamically recalculates and updates this cached payload when there is a change in the status of receipt validation, specifically when the following status changes occur:

  • Approved -> Pending

  • Approved -> Rejected

  • Pending -> Approved

  • Rejected -> Approved

Example Payload Structure

payload = {
    "crop_id": crop_id,
    "crop_name_hi": crop_name_hi,
    "crop_name_hing": crop_name_hing,
    "crop_name_eng": crop_name_eng,
    "last_available_price_date": last_available_price_date,
    "receipt_count": receipt_count,
    "total_quantity": total_quantity,
    "min_price": min_price,
    "median_price": median_price,
    "max_price": max_price,
    "crop_price_data": crop_price_data,
    "mandis": mandis,
    "receipts": receipts,
}

You can refer here for more information about more detailed actions that happen when the status of a receipt is changed.

This meticulous monitoring and updating process ensures that the displayed price distribution consistently mirrors the latest mandi prices. As a result, users can confidently rely on Bolbhav for accurate and up-to-date insights into crop prices, empowering them to make informed decisions regarding their agricultural transactions.

Last updated