I have Rails serving my static assets. Most of them have hashes in their name and are served with far-future expiration dates. But for one file, I can't serve it with a hash in its name, so I need to control the expiration date.
I have this in my application.rb which applies to all static assets:
config.static_cache_control = "public, max-age=2592000"
Is there a way for me to have a different max-age for just one file? I know I can make a new middleware that comes after ActionDispatch::Static
and changes the value for certain files (see this writeup)... but then this will run for every single request, even those which aren't static assets. Is there a more elegant solution?