# Class: LRUCache

This documentation is for OpenLayers v10.9.0. The latest is v.

## ol/structs/LRUCache~LRUCache

Implements a Least-Recently-Used cache where the keys do not conflict with Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring items from the cache is the responsibility of the user.

  ##### Fires:

  - `change` (BaseEvent) - Generic change event. Triggered when the revision counter is increased.
  - `error` (BaseEvent) - Generic error event. Triggered when an error occurs.

### Methods

#### setSize(size)

structs/LRUCache.js, line 296

  Set a maximum number of entries for the cache.

  Name | Type | Description
  --- | --- | ---
  `size` | number | Cache size.