---
title: InsertOptions
summary: Options for non-transactional cache insertions via CoreCache.insert.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/cache/interface.InsertOptions/
---

**Kind:** Interface  
**Module:** [cache](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/cache/)  
**Package:** @fastly/js-compute 4.0.1  
**Since:** 3.9.0  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/cache.d.ts#L161

Extends `TransactionInsertOptions`.

Options for non-transactional cache insertions via [CoreCache.insert](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/cache/class.CoreCache/#method-insert).

## Properties

### headers

**Type:** `HeadersInit`  
**Flags:** optional  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/cache.d.ts#L168

Note: These headers are narrowly useful for implementing cache lookups incorporating the semantics of the HTTP Vary header.
The headers act as additional factors in object selection, and the choice of which headers to factor in is determined during insertion, via the `vary` property within `TransactionInsertOptions`.
A lookup will succeed when there is at least one cached item that matches lookup's `key`, and all of the lookup's headers included in the cache items' `vary` list match the corresponding headers in that cached item.
A typical example is a cached HTTP response, where the request had an "Accept-Encoding" header. In that case, the origin server may or may not decide on a given encoding, and whether that same response is suitable for a request with a different (or missing) Accept-Encoding header is determined by whether Accept-Encoding is listed in Vary header in the origin's response.
