Sha256: 9d94744ecd690b56509728849117aedb9380f8420d5561cdc0b05bdfbc296aee
Contents?: true
Size: 458 Bytes
Versions: 8
Compression:
Stored size: 458 Bytes
Contents
require 'routemaster/cache' module Routemaster module Middleware class ExpireCache def initialize(app, options = {}) @app = app @cache = options.fetch(: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
8 entries across 8 versions & 1 rubygems