I'm working on a Sinatra app and just started adding cacheing. Some of my files are cached correctly, but I keep seeing this warning when serving an image in the public
folder:
WARN: Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true.
I don't understand why I'm getting this warning. Sinatra is serving the file correctly out of the public folder, and it says it defaults this header to the file size.
I'm using the following example settings from the README:
set :static_cache_control => [:public, :max_age => 60]
before do
cache_control :public, :must_revalidate, :max_age => 60
end
How can I get Sinatra to correctly set the content-length header to the static file's size?