module Scrivito class CacheMiddleware def initialize(app) @app = app end def call(env) clear_cache @app.call(env) end private def clear_cache Workspace.cache.clear CmsDataCache.clear_request_cache end end end