'Way to set default Rails Cache-Control header?

I know that to set the Cache-Control header in my own controllers I can call #expires_now, but my Rails app uses an engine (apitome), and on those requests, the Cache-Control header gets set to max-age=0, private, must-revalidate. I see that may be the default value for Rack::ETag here, but I can't figure out how to override it.

When I set Rails.configuration.public_file_server.headers = { 'Cache-Control' => 'no-cache' }, that changes the header for my javascript assets for example, but not the engine.

Is there a way to override the default or a good way to set this setting in the engine? Maybe just monkey patch the controller and add a before_action to set the header?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source