I'm using the latest Sinatra and I'm hosting on Heroku. Is there a way I can set the caching headers for my static assets served from the /public
directory?
Sinatra serves files from the /public
directory before checking any routes that have been defined, so I can’t just the cache_control
method inside a route.
The /public
directory contains the CSS and JavaScript of my app. I don’t want the browser to download those files every single time, since they won't change often.