---
title: Geofence / block access to content by region
summary: Group countries to cache content by custom regions or reject requests from some regions entirely.
url: https://www.fastly.com/documentation/solutions/examples/geofencing-geoblocking-content-by-region
---

Group countries to cache content by custom regions or reject requests from some regions entirely.

## VCL

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

## Compute

### Rust

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

### Javascript

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

### Go

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

