There are two types caching used in Bahmni

  1. Caching reference data at proxy server (Apache)
  2. Caching static resources at client side (Browsers)

Caching reference data at proxy server

This is achieved by setting appropriate "Expires" headers on the HTTP response. The expire headers is set by bahmni-core module - org.openmrs.module.bahmnicore.web.filter.CacheHeadersFilter. Currently we cache all concepts for a duration specified in global property bahmni.cacheHeadersFilter.expiresDuration (in minutes). This allows proxy server like Apache to cache this response for this duration.

Caching static resources at client side

 This is achieved by sending Cache-Control: max-age=xxxxx and Etag headers. There are two types of data which can cached at client side

Static resources with unique urls which can be cached for ever

These static resources  served by apache configured to have appropriate cache headers. This is configured using puppet scripts. The following resources belong this category

  • The javascript and css files. We use finger printing technique to generate unique file names. These files have their md5 checksum appended to the filename.
  • The images uploaded via bahmni apps have a unique url per image (Eg: Radiology Documents, Patient Files, Consultation Images etc) 

Static resources which have single url and might change on each deployment which can be cached for shorter duration

The following resources belong this category

  • Static html files, images in bahmni apps (We'll try to get unique urls for these too in future)
  • The patient images captured in registration


The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)