message: Add simple caching for retrieved snippets
  (to avoid unnecessary RegEx parsing and "EMFILE: too many open files"
  errors)
diff: @@ -8,9 +8,14 @@ const path = require('path')
  import fs = require('fs')
  const { FileSniffer, asArray } = require('filesniffer')
  +const cache = {}
  +
  exports.serveCodeSnippet = () => async (req, res, next) => {
  const challenge = challenges[req.params.challenge]
  if (challenge) {
  + if (cache[challenge.key]) {
  + return res.json(cache[challenge.key])
  + } else {
  const matches = await FileSniffer
  .create()
  .path('./server.ts')
  @@ -42,7 +47,7 @@ exports.serveCodeSnippet = () => async (req, res, next) => {
  }
  }
  snippet = snippet.replace(/[/#]{0,2} vuln-code-snippet vuln-line.*/g, '')
  -
  + cache[challenge.key] = { snippet, vulnLines }
  return res.json({ snippet, vulnLines })
  } else {
  res.status(422).json({ status: 'error', error: 'Broken code snippet boundaries for: ' + challenge.key })
  @@ -50,6 +55,7 @@ exports.serveCodeSnippet = () => async (req, res, next) => {
  } else {
  res.status(404).json({ status: 'error', error: 'No code snippet available for: ' + challenge.key })
  }
  + }
  } else {
  res.status(412).json({ status: 'error', error: 'Unknown challenge key: ' + req.params.challenge })
  }
  