---
title: LookupOptions
summary: LookupOptions control the behavior of cache lookups and the objects returned.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/cache/core/struct.LookupOptions/
---

**Kind:** Struct  
**Module:** [core](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/cache/core/)  
**Package:** compute-sdk-go v1.11.0  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/cache/core/core.go#L244

```go
type LookupOptions struct {
	RequestHeaders fsthttp.Header

	From uint64

	To uint64

	LegacyReturnWholeBody bool
}
```

LookupOptions control the behavior of cache lookups and the objects
returned.

## Fields

### RequestHeaders

**Type:** `fsthttp.Header`

RequestHeaders are a set of HTTP headers that influence cache
lookups when Vary rules are set.

A lookup will succeed when there is at least one cached object
that matches the lookup's cache key, and all of the headers
included in the cached object's Vary list match the corresponding
headers in that cached object.

### From

**Type:** `uint64`

From indicates the starting offset to read from the cached
object.

### To

**Type:** `uint64`

To indicates the ending offset to read from the cached object.  A
value of 0 means to read to the end of the object.

### LegacyReturnWholeBody

**Type:** `bool`

LegacyReturnWholeBody restores a legacy behavior around range requests.

In SDK v1.4.2 and earlier, under certain circumstances the requested range
(From/To) would be ignored. Specifically, if:
- The lookup (reader) is concurrent with the writer of the body
- The size of the cached item's body was not provided by the writer
- The reader requests a specific range of the cached item's body
  (`From` and `To` are provided in LookupOptions or GetBodyOptions)
then the core cache API would ignore the requested range and provide
the entire body, instead of providing just the requested range.

In SDK v1.4.3, the default behavior changed. In a concurrent read/write:
- If From and To are nonzero, the reader will block until the start of
  the requested range has been provided by the writer.
- Only the requested range will be returned to the reader.

Note that the full body is still provided if the range is invalid.

LegacyReturnWholeBody restores the v1.4.2 behavior.
