Socket
Socket
Sign inDemoInstall

@algolia/cache-common

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/cache-common

Common interfaces for promise-based caching libraries


Version published
Maintainers
3
Install size
5.42 kB
Created

Package description

What is @algolia/cache-common?

The @algolia/cache-common package is part of the Algolia ecosystem, designed to provide a common interface and utility functions for implementing caching mechanisms. This package is typically used to enhance performance by reducing the number of API calls needed, thereby saving bandwidth and speeding up response times by storing and retrieving data from a cache.

What are @algolia/cache-common's main functionalities?

Cache Interface

Defines a standard interface for cache operations including setting, getting, and deleting cache entries. This interface ensures consistency across different implementations of caches used in various Algolia libraries.

{
  set(key, value) {
    // implementation code
  },
  get(key) {
    // implementation code
  },
  delete(key) {
    // implementation code
  }
}

InMemoryCache

Provides a basic in-memory cache implementation that can be used to store data within the process memory. Useful for environments where installing external caching systems is not feasible.

const { InMemoryCache } = require('@algolia/cache-common');
const cache = new InMemoryCache();
cache.set('key', 'value').then(() => {
  return cache.get('key');
}).then(value => console.log(value));

Other packages similar to @algolia/cache-common

Changelog

Source

v4.22.0

  • fix(recommend): update TrendingFacetHit facetValue type to string (#1498) (ac9d6e2), closes #1498

FAQs

Package last updated on 14 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc