Skip to content

Releases: fregante/webext-storage-cache

v6.0.3

01 Jul 08:28
Compare
Choose a tag to compare

v6.0.1...v6.0.3

v6.0.0

24 Jul 21:47
Compare
Choose a tag to compare

Major

  • Add CachedValue and CachedFunction (#41) 5255795

The API has changed to improve type safety and extend the capabilities of cache.function.

Migration guide

You can use the legacy API for a gradual migration, but you should start using the new functions before the next major version.

// v5
await cache.set('user-id', 510, {days: 2});
const id = await cache.get('user-id');

// v6
const idCache = new CachedValue('user-id', {maxAge: {days: 2}});

await idCache.set(510);
const id = await idCache.get();
// v5
const cachedGetHTML = cache.function(getHTML, {
	cacheKey: args => args.join(','),
	maxAge: {days: 2},
});

const html = await cachedGetHTML('info.html');

// v6
const cache = new CachedFunction('html', {
	maxAge: {days: 2},
);

const html = await cache.get('info.html');

Bugfixes

  • Only use the storage as cache, not memory (#37) a54fc58

v5.1.1...v6.0.0

v5.1.1

29 Jan 08:34
Compare
Choose a tag to compare

v5.1.0...v5.1.1

v5.1.0

06 Aug 06:58
Compare
Choose a tag to compare
  • Add method to force a refresh from a cached function (#33) 126304e

v5.0.1...v5.1.0

v5.0.1

19 Jul 08:21
Compare
Choose a tag to compare
  • Update dependencies (#32) 3b6f61e
  • Allow import in Node/test environments without causing errors

v5.0.0...v5.0.1

v5.0.0

05 Nov 13:24
Compare
Choose a tag to compare

Changes

It should not bring any breaking changes, but I released it as a major version for safety. The minimum browser version probably increased slightly due to the "es2020" TypeScript output.

  • Update dependencies and lint repo 05102c5
  • Allow cache.set(x, undefined) to delete the cached item (#26) c7a1e23

v4.2.0...v5.0.0

v4.2.0

22 Nov 03:35
Compare
Choose a tag to compare
  • Memoize cache.function so it doesn't get called multiple times (#28) 59790ad

v4.1.1...v4.2.0

v4.1.1

11 Sep 17:21
Compare
Choose a tag to compare
  • Don't purge the cache on just any alarm (#24) 1354876

v4.1.0...v4.1.1

v4.1.0

09 Sep 01:05
Compare
Choose a tag to compare

Enhancements

  • Use chrome.alarms to purge cache where available (#23) a2c38a0

It's not required, but to use this you'll have to include alarms as a permission. This does not appear to the user.

Bugfixes

  • Verify cache expiration in has() and function() (#22) d61d250

v4.0.0...v4.1.0

v4.0.0

18 Aug 00:55
Compare
Choose a tag to compare

Major Changes

  • Use objects to define readable expiration values (#20) 46ca320