Slim4 withHeader cache wont overwrite?

Also beware: the skeleton example app sets Cache-Control in ResponseEmitter (hence for every response!) to no-store, no-cache.
You might want to remove Cache-Control & Pragma, in order to get your load-balancer (e.g. Varnish) to cache correctly and improve performances.

If you want to prevent caching on some specific resource you can use withHeaders('Cache-Control', ... ) on a specific response only for specific routes.

Another alternative is to leave the ResponseEmitter as it is, but use withoutHeaders('Cache-Control'), to unset the default headers and allow to use your own.