Skip to content

Commit

Permalink
Swapping LRU cache for FIFO cache
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Jan 15, 2019
1 parent 5362737 commit bd6e3e7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/etag.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const lru = require("tiny-lru"),
const fifo = require("tiny-fifo"),
mmh3 = require("murmurhash3js").x86.hash32,
{URL} = require("url");

Expand All @@ -18,7 +18,7 @@ function parse (arg) {

class ETag {
constructor (cacheSize, cacheTTL, seed, mimetype) {
this.cache = lru(cacheSize, cacheTTL);
this.cache = fifo(cacheSize, cacheTTL);
this.mimetype = mimetype;
this.seed = seed;
}
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tiny-etag",
"version": "2.0.13",
"version": "2.0.14",
"description": "ETag middleware",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,14 +29,14 @@
"homepage": "http://avoidwork.github.io/tiny-etag/",
"dependencies": {
"murmurhash3js": "^3.0.1",
"tiny-lru": "^5.1.2"
"tiny-fifo": "^1.0.4"
},
"devDependencies": {
"grunt": "^1.0.3",
"grunt-eslint": "^21.0.0",
"grunt-mocha-test": "^0.13.3",
"mocha": "^5.2.0",
"tiny-httptest": "^1.0.22",
"woodland": "^7.3.34"
"woodland": "^7.3.38"
}
}

0 comments on commit bd6e3e7

Please sign in to comment.