---
title: Load balance to optimise upstream caching with hash directors
summary: Map requests to backends consistently, which can be useful to improve your internal cache and replication efficiency.
url: https://www.fastly.com/documentation/solutions/examples/consistent-hashing-director
---

Map requests to backends consistently, which can be useful to improve your internal cache and replication efficiency.

## VCL

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/02cb5c96)

## Compute

### Rust

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/fc272532)

### Javascript

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/f189e3c1)

