npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@breadstone/ziegel-platform-caching

v0.0.9

Published

Includes functionalities to cache data.

Downloads

105

Readme

@breadstone/ziegel-platform-caching

MIT License TypeScript npm

Caching infrastructure and memory management for the ziegel platform. Provides multiple cache implementations, eviction policies, cache factories, and memory-efficient caching strategies for enterprise applications.

Caching: Enterprise caching with multiple strategies, eviction policies, and memory management for high-performance applications.

🚀 Overview

@breadstone/ziegel-platform-caching provides:

  • Multiple Cache Types: Session, transient, and infinite caching strategies
  • Eviction Policies: Configurable cache eviction and cleanup policies
  • Cache Factory: Factory pattern for creating and managing cache instances
  • Cache Items: Wrapper objects for cached data with metadata
  • Caching Modes: Different caching behaviors and strategies
  • Memory Management: Efficient memory usage and garbage collection support

📦 Installation

npm install @breadstone/ziegel-platform-caching
# or
yarn add @breadstone/ziegel-platform-caching

🧩 Features & Usage Examples

Basic Caching

import { CacheManager, MemoryCache } from '@breadstone/ziegel-platform-caching';

const cache = new MemoryCache();
const cacheManager = new CacheManager(cache);

// Set cache value
await cacheManager.set('user:123', userData, { ttl: 3600 });

// Get cache value
const user = await cacheManager.get<User>('user:123');

// Remove from cache
await cacheManager.remove('user:123');

Cache Decorators

import { Cacheable, CacheEvict } from '@breadstone/ziegel-platform-caching';

class UserService {
  @Cacheable('users', { ttl: 3600 })
  async getUser(id: string): Promise<User> {
    return await this.userRepository.findById(id);
  }

  @CacheEvict('users')
  async updateUser(id: string, data: Partial<User>): Promise<User> {
    return await this.userRepository.update(id, data);
  }
}

Multi-Level Cache

import {
  MultiLevelCache,
  MemoryCache,
  StorageCache,
  RedisCache
} from '@breadstone/ziegel-platform-caching';

const l1 = new MemoryCache({ maxSize: 1000 });
const l2 = new StorageCache({ storageKey: 'app-cache' });
const l3 = new RedisCache({ host: 'redis-server' });

const multiCache = new MultiLevelCache([l1, l2, l3]);

Cache Strategies

import {
  LRUCacheStrategy,
  TTLCacheStrategy,
  CompositeCacheStrategy
} from '@breadstone/ziegel-platform-caching';

const lruStrategy = new LRUCacheStrategy({ maxSize: 1000 });
const ttlStrategy = new TTLCacheStrategy({ defaultTtl: 3600 });
const strategy = new CompositeCacheStrategy([lruStrategy, ttlStrategy]);

Distributed Caching

import { DistributedCache, RedisProvider } from '@breadstone/ziegel-platform-caching';

const redisProvider = new RedisProvider({
  host: 'cache-cluster.example.com',
  port: 6379,
  cluster: true
});

const distributedCache = new DistributedCache(redisProvider);
await distributedCache.set('global:config', config);

Cache Metrics

import { CacheMetrics, CacheAnalytics } from '@breadstone/ziegel-platform-caching';

const metrics = new CacheMetrics();
const analytics = new CacheAnalytics(metrics);

// Get cache statistics
const stats = analytics.getStatistics();
console.log(`Hit Rate: ${stats.hitRate}%`);
console.log(`Miss Count: ${stats.missCount}`);

📚 Package import points

import {
    // Core Caching
    CacheManager,
    ICache,
    CacheEntry,

    // Cache Implementations
    MemoryCache,
    StorageCache,
    RedisCache,
    MultiLevelCache,

    // Strategies
    LRUCacheStrategy,
    TTLCacheStrategy,
    CompositeCacheStrategy,

    // Decorators
    Cacheable,
    CacheEvict,
    CacheInvalidate,

    // Distributed
    DistributedCache,
    RedisProvider,

    // Metrics
    CacheMetrics,
    CacheAnalytics
} from '@breadstone/ziegel-platform-caching';

📚 API Documentation

For detailed API documentation, visit: API Docs

Related Packages

  • @breadstone/ziegel-platform: Core platform services
  • @breadstone/ziegel-core: Foundation utilities
  • @breadstone/ziegel-platform-configuration: Configuration management

License

MIT

Issues

Please report bugs and feature requests in the Issue Tracker


Part of the ziegel Enterprise TypeScript Framework