New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@remembered/s3-alternative-persistence

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remembered/s3-alternative-persistence

S3 alternative persistence implementation for remembered redis

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
0
Created
Source

Actions Status Actions Status Actions Status Test Coverage Maintainability Packages npm version

S3 alternative persistence implementation for remembered redis

How to Install

npm i @remembered/s3-alternative-persistence

How to use

When creating a RememberedRedis instance, just inform the alternative persistence, as below

const remembered = new RememberedRedis(
  {
    ttl: 0,
    redisTtl: 3600,
    redisPrefix: 's3-cache',
    alternativePersistence: new S3Cache({
      s3, // s3 instance
      redis, // redis instance. optional
      bucketName: 'my-bucket',
      maxSavingDelay: 3,
      transientTtl: 300
    ),
  },
  redisInstance,
);

maxSavingDelay is meant to indicate to RememberedRedis how much it need to wait until the cache is save. The longer it waits, more values are inserted in the same S3 file, saving some requests, but bigger is the file and the memory consumption to deal with it, so measure that one carefully for your need. transientTll defines the maximum ttl to keep the same file content on redis. This is useful if you have some spare memory on your redis instance and wants to use it to make less GET requests on S3, saving some money with it. Also measure that for your need, and if you want to avoid using it at all, don't inform a redis instance, don't inform this property or inform it as 0.

You can also listen for error events: saveError and fetchingError. This will be emitted when either the communication with redis or S3 fails

License

Licensed under MIT.

FAQs

Package last updated on 07 Oct 2024

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