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

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