---
title: cache_generation
summary: The current cache identifier for this Fastly service.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/compute_runtime/fn.cache_generation/
---

**Kind:** Function  
**Module:** [compute_runtime](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/compute_runtime/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/compute_runtime.rs#118

```rust
fn cache_generation() -> u64
```

The current cache identifier for this Fastly service.

Equivalent to the "FASTLY_CACHE_GENERATION" environment variable and to [`req.vcl.generation`](https://www.fastly.com/documentation/reference/vcl/variables/miscellaneous/req-vcl-generation/)
in VCL.

**Returns**

`u64`
