Hi, How can I implement caching for static content...
# http4k
t
Hi, How can I implement caching for static content in http4k?
d
You should probably use standard http cache with headers etc, but if you really want to do it you can using the TrafficFilters from the core module
Copy code
val cache = ReadWriteCache.Memory()
val handler = TrafficFilters.ServeCachedFrom(cache)
    .then(TrafficFilters.RecordTo(cache))
    .then(static())
1