HoneyryderChuck 0d23c464f5 simplifying response cache store API
#get, #set, #clear, that's all you need. this can now be some bespoke custom class implementing these primitives
2025-04-12 22:09:12 +01:00

19 lines
417 B
Ruby

# frozen_string_literal: true
require_relative "test"
class ResponseCacheServer < TestServer
class NoCacheApp < WEBrick::HTTPServlet::AbstractServlet
def do_GET(_req, res) # rubocop:disable Naming/MethodName
res.status = 200
res.body = "no-cache"
res["Cache-Control"] = "private, no-store"
end
end
def initialize(options = {})
super
mount("/no-store", NoCacheApp)
end
end