# desktop-mode/1.1.9/includes/framework/app/contracts/interface-cache.php

OpenStation: Desktop Windows, Dock &amp; Virtual Desktops for WP Admin, version 1.1.9. 48 lines.

- Page: https://pluginprobe.com/plugins/desktop-mode/1.1.9/code/includes/framework/app/contracts/interface-cache.php
- Raw: https://pluginprobe.com/plugins/desktop-mode/1.1.9/raw/includes/framework/app/contracts/interface-cache.php
- Modified: 2026-09-04T15:30:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/desktop-mode/1.1.9/code/includes/framework/app/contracts/interface-cache.php#L10-L20`.

```php
<?php
/**
 * OpenStation App Framework — Cache contract.
 *
 * A best-effort key/value cache. A miss must be indistinguishable
 * from "never stored" — apps only ever use it to skip work they can
 * redo, never as storage.
 *
 * @package OpenStation
 */

namespace OpenStation\App\Contracts;

// Direct access, unless a standalone host is booting on bare PHP.
if ( ! defined( 'ABSPATH' ) ) {
	defined( 'OPENSTATION_STANDALONE' ) || exit;
}

interface Cache {

	/**
	 * Read a cached value.
	 *
	 * @param string $key      Cache key.
	 * @param mixed  $fallback Returned on a miss.
	 * @return mixed
	 */
	public function get( $key, $fallback = null );

	/**
	 * Store a value.
	 *
	 * @param string $key   Cache key.
	 * @param mixed  $value Any serialisable value.
	 * @param int    $ttl   Lifetime in seconds; 0 for "as long as the host keeps it".
	 * @return void
	 */
	public function set( $key, $value, $ttl = 0 );

	/**
	 * Forget a value.
	 *
	 * @param string $key Cache key.
	 * @return void
	 */
	public function delete( $key );
}

```
