Skip to content

Commit

Permalink
add LRU cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jezhiggins committed Sep 10, 2019
1 parent f561556 commit 14ffaf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web-server/actions/authenticate-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import LRU from 'lru-cache';
import { getTempFilename as tempFilename } from 'express-fileupload/lib/utilities';
import { authenticatePhoto } from '../imagehash/authenticate-photo'

const cache = new LRU(500);
const cache = new LRU({
max: 500,
maxAge: 60 * 60 * 1000
});

async function authenticate(req, res) {
const imageUrl = req.query.url;
Expand Down

0 comments on commit 14ffaf0

Please sign in to comment.