Sha256: 54d68797aaa91778945f7215edcc8a04e8755a9cca534d92649c136f8649b149
Contents?: true
Size: 443 Bytes
Versions: 18
Compression:
Stored size: 443 Bytes
Contents
require 'routemaster/cache' module Routemaster module Middleware class ExpireCache def initialize(app, cache:nil, **_) @app = app @cache = cache || Routemaster::Cache.new end def call(env) env.fetch('routemaster.payload', []).each do |event| next if event['type'] == 'noop' @cache.invalidate(event['url']) end @app.call(env) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems