# solid-performance/1.9.0/src/Performance/Admin/package/preload/preload-id.js

Solid Performance – Your No-Code Caching, Performance, &amp; Page Speed Solution, version 1.9.0. 34 lines.

- Page: https://pluginprobe.com/plugins/solid-performance/1.9.0/code/src/Performance/Admin/package/preload/preload-id.js
- Raw: https://pluginprobe.com/plugins/solid-performance/1.9.0/raw/src/Performance/Admin/package/preload/preload-id.js
- Modified: 2025-02-13T01:04:32+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/solid-performance/1.9.0/code/src/Performance/Admin/package/preload/preload-id.js#L10-L20`.

```javascript
/**
 * Store the unique preload ID in order to prevent notifications from
 * displaying over and over when the REST endpoint is polled.
 */
const preloadIdKey = 'swpsp-preload-id';

export const PreloadId = {
	/**
	 * Retrieve the preload ID from sessionStorage.
	 *
	 * @returns {string|null} The stored preload ID, or `null` if it doesn't exist.
	 */
	get: () => sessionStorage.getItem(preloadIdKey),

	/**
	 * Set the preload ID in sessionStorage.
	 *
	 * @param {string} id The preload ID to store.
	 */
	set: (id) => sessionStorage.setItem(preloadIdKey, id),

	/**
	 * Check if the preload ID exists in sessionStorage.
	 *
	 * @returns {boolean} `true` if the preload ID exists, otherwise `false`.
	 */
	has: () => sessionStorage.getItem(preloadIdKey) !== null,

	/**
	 * Clear the preload ID.
	 */
	clear: () => sessionStorage.removeItem(preloadIdKey),
};

```
