Caching Patterns
  • 25 Jun 2024
  • 1 Minute to read
  • Dark
    Light

Caching Patterns

  • Dark
    Light

Article summary

There are two patterns for caching. Below are descriptions of each, how to set them up, and best practice recommendations.


Just In Time

This pattern is best in clustered server environments because it allows the cache to be filled node by node. 

The below mock-up is an example of a Just In Time and Bespoke Cache Flow. This Flow uses two Get From Cache steps, one Put in Cache step and one Is Empty rule.

The Flow will check data in the cache, then run it through the Is Empty rule. Data that is not in the cache will be added with the Put in Cache step.

Prime The Pump

In this method data from the cache is loaded as soon as a server comes online to prefill desired forms, data structures, etc.

The issue with Prime The Pump is that it can burden the origin database when the Flow runs and all that data needs to be transferred into cache.

The best recommendation is to build a Scheduled Job that is set to run at startup or a Startup Job when the service comes online. This will keep cache loading service hit from happening at runtime.

In clustered server environments a system will need to be implemented to allow the cache to work across clusters.


Was this article helpful?

What's Next